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: enable 128-bit TraceID generation by default #2335

Merged
merged 4 commits into from
Nov 10, 2023

Conversation

katiehockman
Copy link
Contributor

@katiehockman katiehockman commented Nov 6, 2023

What does this PR do?

Changes DD_TRACE_128_BIT_TRACEID_GENERATION_ENABLED default to true

Note that DD_TRACE_128_BIT_TRACEID_LOGGING_ENABLED default does not change, and it remains false.

Motivation

Better support W3C standards for TraceID

Reviewer's Checklist

  • Changed code has unit tests for its functionality at or near 100% coverage.
  • There is a benchmark for any new code, or changes to existing code.
  • If this interacts with the agent in a new way, a system test has been added.

For Datadog employees:

  • If this PR touches code that handles credentials of any kind, such as Datadog API keys, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

Unsure? Have a question? Request a review!
AIT-8848

@pr-commenter
Copy link

pr-commenter bot commented Nov 6, 2023

Benchmarks

Benchmark execution time: 2023-11-10 10:04:50

Comparing candidate commit 07e257e in PR branch katie.hockman/128-default with baseline commit 9d39644 in branch main.

Found 0 performance improvements and 8 performance regressions! Performance is the same for 31 metrics, 2 unstable metrics.

scenario:BenchmarkOTelApiWithCustomTags/datadog_otel_api-24

  • 🟥 allocated_mem [+93 bytes; +102 bytes] or [+2.651%; +2.913%]
  • 🟥 allocations [+2; +2] or [+7.143%; +7.143%]
  • 🟥 execution_time [+125.363ns; +195.437ns] or [+2.498%; +3.895%]

scenario:BenchmarkOTelApiWithCustomTags/otel_api-24

  • 🟥 allocated_mem [+99 bytes; +110 bytes] or [+2.640%; +2.934%]
  • 🟥 allocations [+2; +2] or [+6.452%; +6.452%]
  • 🟥 execution_time [+190.315ns; +266.085ns] or [+3.279%; +4.584%]

scenario:BenchmarkTracerAddSpans-24

  • 🟥 allocations [+2; +2] or [+8.696%; +8.696%]
  • 🟥 execution_time [+114.939ns; +155.461ns] or [+2.990%; +4.044%]

ddtrace/tracer/textmap_test.go Outdated Show resolved Hide resolved
@darccio
Copy link
Contributor

darccio commented Nov 7, 2023

@katiehockman I think the other test that fails can be fixed like this:

func TestSpanWithoutNewRoot(t *testing.T) {
	assert := assert.New(t)
	otel.SetTracerProvider(NewTracerProvider())
	tr := otel.Tracer("")

	parent, ddCtx := tracer.StartSpanFromContext(context.Background(), "otel.child")
	_, child := tr.Start(ddCtx, "otel.child")
	// Change the rest of the method with the following lines:
	parentCtxW3C := parent.Context().(ddtrace.SpanContextW3C)
	assert.Equal(parentCtxW3C.TraceID128Bytes(), [16]byte(child.SpanContext().TraceID()))
}

@katiehockman
Copy link
Contributor Author

Thanks @darccio !!

@katiehockman katiehockman marked this pull request as ready for review November 9, 2023 20:40
@katiehockman katiehockman requested a review from a team November 9, 2023 20:40
@darccio darccio self-requested a review November 10, 2023 08:58
@darccio darccio merged commit 491dab0 into main Nov 10, 2023
51 checks passed
@darccio darccio deleted the katie.hockman/128-default branch November 10, 2023 11:28
@darccio darccio restored the katie.hockman/128-default branch November 16, 2023 15:27
@darccio darccio deleted the katie.hockman/128-default branch November 16, 2023 15:40
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