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 TracingUUID toString string format #1311

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

changm4n
Copy link
Contributor

What and why?

There is a bug in the creation of the traceparent of the trace http header.
The type of TracingUUID.rawValue is UInt64, but it is converted to 32 bits when converted like [format: "%16x"].
When trace id : 7242571286695202638(decimal), the traceparent header value is being generated as [version]-00000000000000000000000063e94f4e-[parent id]-[trace flags] now.

How?

Use the %llx format when converting strings of type UInt64.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests
  • Run integration tests
  • Run smoke tests

@changm4n changm4n requested a review from a team as a code owner June 17, 2023 11:27
Copy link
Member

@maciejburda maciejburda left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution! That's a great catch!

@changm4n changm4n changed the title fix TracingUUID toString string format Fix TracingUUID toString string format Jun 19, 2023
@maciejburda
Copy link
Member

Screenshot 2023-06-22 at 13 58 04

Copy link
Member

@ncreated ncreated left a comment

Choose a reason for hiding this comment

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

Thanks a million @changm4n 🏅. We haven't heard of this causing a problem before, could you please describe what was the impact on your side?

@changm4n
Copy link
Contributor Author

@ncreated The datadog agent on the backend was using the trace id in the request header received from the client, but the trace id sent to datadog from the client was different from the trace id sent to datadog from the backend, so it was being recognised as a different trace.

@ncreated ncreated merged commit 18d46c6 into DataDog:develop Jun 26, 2023
@ncreated
Copy link
Member

@ncreated The datadog agent on the backend was using the trace id in the request header received from the client, but the trace id sent to datadog from the client was different from the trace id sent to datadog from the backend, so it was being recognised as a different trace.

Thank you @changm4n, that helps us prioritising release of this fix 👍

@maciejburda maciejburda mentioned this pull request Jun 26, 2023
6 tasks
maxep added a commit that referenced this pull request Jun 27, 2023
@maxep maxep mentioned this pull request Jun 27, 2023
6 tasks
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