Skip to content

sentry: use config JSON consistently #1463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/external/sentry.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
const Sentry = require('@sentry/node'); // eslint-disable-line no-shadow
Sentry.init({
dsn: `https://${config.key}@${config.orgSubdomain}.ingest.sentry.io/${config.project}`,
environment: process.env.SENTRY_ENVIRONMENT || 'production',
environment: config.environment || 'production',
tracesSampleRate: Number(config.traceRate || 0),
beforeSend(event, hint) {
const sanitizedEvent = sanitizeEventRequest(event);
Expand All @@ -153,9 +153,8 @@
const username = require('os').hostname();
Sentry.setUser({ username });

if (process.env.SENTRY_TAGS) {
const tags = JSON.parse(process.env.SENTRY_TAGS);
for (const [key, value] of Object.entries(tags))
if (isPresent(config.tags)) {

Check failure on line 156 in lib/external/sentry.js

View workflow job for this annotation

GitHub Actions / standard-tests

'isPresent' is not defined
for (const [key, value] of Object.entries(config.tags))
Sentry.setTag(key, value);
}

Expand Down
Loading