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(monitors): Pass SENTRY_TRACE_ID down execution path #1441
feat(monitors): Pass SENTRY_TRACE_ID down execution path #1441
Conversation
src/commands/monitors/run.rs
Outdated
// Inherit outer SENTRY_TRACE_ID if present | ||
if env::var_os("SENTRY_TRACE_ID").is_none() { | ||
p.env("SENTRY_TRACE_ID", trace_id.to_string().replace("-", "")); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Inherit outer SENTRY_TRACE_ID if present | |
if env::var_os("SENTRY_TRACE_ID").is_none() { | |
p.env("SENTRY_TRACE_ID", trace_id.to_string().replace("-", "")); | |
} | |
// Inherit outer SENTRY_TRACE_ID if present | |
let trace_id = env::var_os("SENTRY_TRACE_ID").unwrap_or_else(|| Uuid::new_v4().simple().to_string()); | |
p.env("SENTRY_TRACE_ID", trace_id); | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if it compiles correctly, as I wrote it directly in a suggestion 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also run make lint
and make format
.
src/commands/monitors/run.rs
Outdated
let trace_id = Uuid::new_v4(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let trace_id = Uuid::new_v4(); |
089b78f
to
b0c09df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm doing a release, so will allow myself to merge that one
Oh wait, I wasn't ready to merge this hahaha |
Oh, then it should be a draft 🌝 but no harm done, as it's a self-contained change and will not break anything. |
This adds
SENTRY_TRACE_ID
to the environ of the executing command.This is in support of getsentry/sentry#43647
and will allow SDKs embedded in the executing command to associate the
monitor checkin to any events produced by the SDK.
This is the second part of #1438