Skip to content
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

feat(node): Populate propagation context using env variables #8422

Merged
merged 8 commits into from
Jun 29, 2023

Conversation

AbhiPrasad
Copy link
Member

Requires #8421 to be merged

ref #8352

This PR adds support for https://github.com/getsentry/rfcs/blob/main/text/0071-continue-trace-over-process-boundaries.md via propagation context. When the Node SDK initializes, it grabs process.env.SENTRY_TRACE and process.env.SENTRY_BAGGAGE and uses them to populate the existing propagation context.

In future PRs (tracked by #8352), we will be adding support for transactions/outgoing requests to use propagation context, but for now we are only storing in propagation context, not doing anything with it.

@AbhiPrasad AbhiPrasad requested review from a team, lforst and Lms24 and removed request for a team June 28, 2023 21:34
@AbhiPrasad AbhiPrasad self-assigned this Jun 28, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 28, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 21.78 KB (+1.32% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 68.44 KB (+1.26% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 20.08 KB (+1.32% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 59.72 KB (+1.38% 🔺)
@sentry/browser - Webpack (gzipped + minified) 21.69 KB (+1.2% 🔺)
@sentry/browser - Webpack (minified) 70.83 KB (+1.38% 🔺)
@sentry/react - Webpack (gzipped + minified) 21.72 KB (+1.21% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 50.1 KB (+0.59% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 29.64 KB (+0.87% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 27.72 KB (+0.85% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 49.43 KB (+0.19% 🔺)
@sentry/replay - Webpack (gzipped + minified) 43.12 KB (+0.04% 🔺)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 69.07 KB (+0.37% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 61.65 KB (+0.44% 🔺)

Comment on lines 302 to 307
const sentryUseEnvironment = process.env.SENTRY_USE_ENVIRONMENT;
if (
!['false', 'False', 'FALSE', 'n', 'no', 'No', 'NO', 'off', 'Off', 'OFF', '0'].includes(
sentryUseEnvironment as string,
)
) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const sentryUseEnvironment = process.env.SENTRY_USE_ENVIRONMENT;
if (
!['false', 'False', 'FALSE', 'n', 'no', 'No', 'NO', 'off', 'Off', 'OFF', '0'].includes(
sentryUseEnvironment as string,
)
) {
const sentryUseEnvironment = (process.env.SENTRY_USE_ENVIRONMENT || '').toLowerCase();
if (!['false', 'n', 'no', 'off', '0'].includes(sentryUseEnvironment)) {

l: Not a big thing, but seems easier & clearer to transform to lowercase before checking this?

Base automatically changed from abhi-prop-context-twp to develop June 29, 2023 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants