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

fix(uptime): fix trace header format #238

Merged
merged 2 commits into from
Feb 6, 2025
Merged

fix(uptime): fix trace header format #238

merged 2 commits into from
Feb 6, 2025

Conversation

JoshFerge
Copy link
Member

we need to remove dashes from the trace_id when we create the trace header. adds assertions on the number of dashes to assure correct format.

@JoshFerge JoshFerge requested a review from a team as a code owner February 6, 2025 17:02
@JoshFerge JoshFerge enabled auto-merge (squash) February 6, 2025 17:04
@JoshFerge JoshFerge merged commit 21e5303 into main Feb 6, 2025
7 checks passed
@JoshFerge JoshFerge deleted the jferg/fix-trace branch February 6, 2025 17:07
@@ -173,10 +173,13 @@ fn make_trace_header(config: &CheckConfig, trace_id: &Uuid, span_id: SpanId) ->
// according to the service's sampling policy. see
// https://develop.sentry.dev/sdk/telemetry/traces/#header-sentry-trace
// for more information.

let trace_id_without_dashes = trace_id.to_string().replace("-", "");
Copy link
Member

Choose a reason for hiding this comment

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

I think the better way to do this would be to use the Simple formatter https://docs.rs/uuid/latest/uuid/fmt/struct.Simple.html

Copy link
Member

Choose a reason for hiding this comment

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

Could just be trace_id.simple() and then the Display trait will handle things correctly.

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.

3 participants