Skip to content

Commit

Permalink
add mapping for api keys
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiiaSvietlova committed Dec 17, 2024
1 parent 75f973c commit a32e9b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# BugSnag
BUGSNAG_API_KEY=<your-api-key>
BUGSNAG_API_KEY=<your-api-key>
BUGSNAG_APP_VERSION=1.0.0
BUGSNAG_RELEASE_STAGE=production

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ services:
- OTEL_COLLECTOR_HOST
- FLAGD_HOST
- FLAGD_PORT
- FRONTEND_BUGSNAG_API_KEY
- BUGSNAG_API_KEY=${FRONTEND_BUGSNAG_API_KEY}
- BUGSNAG_APP_VERSION
- BUGSNAG_RELEASE_STAGE
depends_on:
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ declare global {
NEXT_PUBLIC_OTEL_SERVICE_NAME?: string;
NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT?: string;
IS_SYNTHETIC_REQUEST?: string;
FRONTEND_BUGSNAG_API_KEY: string;
BUGSNAG_API_KEY: string;
BUGSNAG_APP_VERSION: string;
BUGSNAG_RELEASE_STAGE: string;
};
Expand All @@ -48,11 +48,11 @@ const resolveRoute = function resolveRoute (url: URL): string {

if (typeof window !== 'undefined') {
Bugsnag.start({
apiKey: window.ENV.FRONTEND_BUGSNAG_API_KEY,
apiKey: window.ENV.BUGSNAG_API_KEY,
});

BugsnagPerformance.start({
apiKey: window.ENV.FRONTEND_BUGSNAG_API_KEY,
apiKey: window.ENV.BUGSNAG_API_KEY,
appVersion: window.ENV.BUGSNAG_APP_VERSION,
releaseStage: window.ENV.BUGSNAG_RELEASE_STAGE,
serviceName: 'opentelemetry-demo-frontend',
Expand All @@ -77,7 +77,7 @@ if (typeof window !== 'undefined') {
const useTLS = window.location.protocol === 'https:';
let port = useTLS ? 443 : 80;
if (window.location.port) {
port = parseInt(window.location.port, 10);
port = parseInt(window.location.port, 10);
}

OpenFeature.setProvider(
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default class MyDocument extends Document<{ envString: string }> {
NEXT_PUBLIC_OTEL_SERVICE_NAME: '${process.env.WEB_OTEL_SERVICE_NAME}',
NEXT_PUBLIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: '${otlpTracesEndpoint}',
IS_SYNTHETIC_REQUEST: '${isSyntheticRequest}',
FRONTEND_BUGSNAG_API_KEY: '${process.env.FRONTEND_BUGSNAG_API_KEY}',
BUGSNAG_API_KEY: '${process.env.BUGSNAG_API_KEY}',
BUGSNAG_APP_VERSION: '${process.env.BUGSNAG_APP_VERSION}',
BUGSNAG_RELEASE_STAGE: '${process.env.BUGSNAG_RELEASE_STAGE}',
};`;
Expand Down

0 comments on commit a32e9b9

Please sign in to comment.