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

tracer: fix trace id logging #1746

Merged
merged 2 commits into from
Feb 21, 2023
Merged

Conversation

katiehockman
Copy link
Contributor

What does this PR do?

When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is false, only the lower-order 64-bits of the TraceId should be logged.
When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is true, the format of the injected TraceId is conditional based on the higher-order 64 bits of the TraceId - specifically, when:

  • zero - the injected TraceId will be its decimal string encoding (preserving the current behavior of 64-bit TraceIds)
  • non-zero - the injected TraceId will be encoded as 32 lower-case hexadecimal characters with zero-padding as necessary

Motivation

The logging requirements of the RFC recently changed, so this is to align with other tracers.

Describe how to test/QA your changes

Reviewer's Checklist

  • If known, an appropriate milestone has been selected; otherwise the Triage milestone is set.
  • Changed code has unit tests for its functionality.
  • If this interacts with the agent in a new way, a system test has been added.

@katiehockman katiehockman added this to the v1.48.0 milestone Feb 17, 2023
@katiehockman katiehockman marked this pull request as ready for review February 17, 2023 21:25
@katiehockman katiehockman requested a review from a team February 17, 2023 21:25
@pr-commenter
Copy link

pr-commenter bot commented Feb 17, 2023

Benchmarks

Comparing candidate commit 4deed49 in PR branch katiehockman/128-bit with baseline commit 19ad9ee in branch shared/128-bit.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 6 cases.

Copy link
Contributor

@ajgajg1134 ajgajg1134 left a comment

Choose a reason for hiding this comment

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

Looks good! just one minor ask in the tests

ddtrace/tracer/span_test.go Show resolved Hide resolved
@katiehockman katiehockman merged commit 2d6021e into shared/128-bit Feb 21, 2023
@katiehockman katiehockman deleted the katiehockman/128-bit branch February 21, 2023 22:16
katiehockman added a commit that referenced this pull request Mar 7, 2023
When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is false, only the lower-order 64-bits of the TraceId should be logged.
When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is true, the format of the injected TraceId is conditional based on the higher-order 64 bits of the TraceId - specifically, when:
zero - the injected TraceId will be its decimal string encoding (preserving the current behavior of 64-bit TraceIds)
non-zero - the injected TraceId will be encoded as 32 lower-case hexadecimal characters with zero-padding as necessary
katiehockman added a commit that referenced this pull request Mar 7, 2023
When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is false, only the lower-order 64-bits of the TraceId should be logged.
When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is true, the format of the injected TraceId is conditional based on the higher-order 64 bits of the TraceId - specifically, when:
zero - the injected TraceId will be its decimal string encoding (preserving the current behavior of 64-bit TraceIds)
non-zero - the injected TraceId will be encoded as 32 lower-case hexadecimal characters with zero-padding as necessary
katiehockman added a commit that referenced this pull request Mar 27, 2023
When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is false, only the lower-order 64-bits of the TraceId should be logged.
When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is true, the format of the injected TraceId is conditional based on the higher-order 64 bits of the TraceId - specifically, when:
zero - the injected TraceId will be its decimal string encoding (preserving the current behavior of 64-bit TraceIds)
non-zero - the injected TraceId will be encoded as 32 lower-case hexadecimal characters with zero-padding as necessary
katiehockman added a commit that referenced this pull request Mar 28, 2023
When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is false, only the lower-order 64-bits of the TraceId should be logged.
When DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED is true, the format of the injected TraceId is conditional based on the higher-order 64 bits of the TraceId - specifically, when:
zero - the injected TraceId will be its decimal string encoding (preserving the current behavior of 64-bit TraceIds)
non-zero - the injected TraceId will be encoded as 32 lower-case hexadecimal characters with zero-padding as necessary
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

2 participants