-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix review comments and fix merge conflicts (#95)
adding Sentry monitoring for runner
- Loading branch information
1 parent
97f38df
commit 394aaaa
Showing
7 changed files
with
48 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,10 @@ network: | |
# | ||
# Pass environment variables as key value pairs. | ||
variables: | ||
SENTRY_DSN: "https://[email protected]/4508573162864640" | ||
SENTRY_TRACES_SAMPLE_RATE: 1.0 | ||
ACCESSIBILITY_STATEMENT_URL: "https://frontend.${COPILOT_ENVIRONMENT_NAME}.access-funding.test.levellingup.gov.uk/accessibility_statement" | ||
SENTRY_ENV: ${COPILOT_ENVIRONMENT_NAME} | ||
AWS_BUCKET_NAME: | ||
from_cfn: ${COPILOT_APPLICATION_NAME}-${COPILOT_ENVIRONMENT_NAME}-FormUploadsBucket | ||
BASIC_AUTH_ON: false | ||
|
@@ -118,6 +121,7 @@ environments: | |
PRIVACY_POLICY_URL: "https://frontend.access-funding.levellingup.gov.uk/privacy" | ||
SERVICE_START_PAGE: "https://frontend.access-funding.levellingup.gov.uk/account" | ||
ELIGIBILITY_RESULT_URL: "https://frontend.access-funding.levellingup.gov.uk/eligibility-result" | ||
SENTRY_TRACES_SAMPLE_RATE: 0.02 | ||
count: | ||
range: 2-4 | ||
cooldown: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
import createServer from "./server"; | ||
|
||
createServer({}) | ||
.then((server) => server.start()) | ||
.then(() => process.send && process.send("online")) | ||
.catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); | ||
.then((server) => server.start()) | ||
.then(() => process.send && process.send("online")) | ||
.then(() => console.log("*** SERVER STARTED ***")) | ||
.catch((err) => { | ||
console.error(err); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {config} from "./server/plugins/utils/AdapterConfigurationSchema"; | ||
import * as Sentry from "@sentry/node"; | ||
import {NodeOptions} from "@sentry/node"; | ||
|
||
if (config.sentryDsn) { | ||
const sentryConfig: NodeOptions = { | ||
dsn: config.sentryDsn, // Replace with your Sentry DSN | ||
environment: config.sentryEnv || "development" // Use the provided environment or default to "development" | ||
}; | ||
// Include tracesSampleRate only if it's available | ||
if (config.sentryTracesSampleRate) { | ||
sentryConfig.tracesSampleRate = Number(config.sentryTracesSampleRate); | ||
} | ||
console.log(`[SENTRY MONITORING ENABLED] Environment: ${sentryConfig.environment} Sample Rate: ${sentryConfig.tracesSampleRate} DSN Available`); | ||
Sentry.init(sentryConfig); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters