Skip to content

Commit

Permalink
Merge pull request github#36023 from github/repo-sync
Browse files Browse the repository at this point in the history
Repo sync
  • Loading branch information
docs-bot authored Jan 22, 2025
2 parents c80a47f + 6c789b8 commit 4c432fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/frame/middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export default function (app: Express) {
}

// *** Observability ***
if (process.env.MODA_PROD_SERVICE_ENV) {
if (process.env.MODA_PROD_SERVICE_ENV === 'true') {
app.use(datadog)
}

Expand Down
2 changes: 1 addition & 1 deletion src/observability/lib/statsd.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
DD_AGENT_HOST,
} = process.env

const mock = NODE_ENV === 'test' || !MODA_PROD_SERVICE_ENV
const mock = NODE_ENV === 'test' || MODA_PROD_SERVICE_ENV !== 'true'

// MODA_APP_NAME gets set when the deploy target is Moda
const modaApp = MODA_APP_NAME ? `moda_app_name:${MODA_APP_NAME}` : false
Expand Down
3 changes: 2 additions & 1 deletion src/observability/middleware/trigger-error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export default async function triggerError(
// pattern used on async middleware! This is an intentional omission!

// prevent this from being used in production
if (process.env.NODE_ENV === 'production' && process.env.MODA_PROD_SERVICE_ENV) return next()
if (process.env.NODE_ENV === 'production' && process.env.MODA_PROD_SERVICE_ENV === 'true')
return next()

throw new Error('Intentional error')
}

0 comments on commit 4c432fb

Please sign in to comment.