Datadog Baggage API#3069
Conversation
Datadog ReportBranch report: ✅ 0 Failed, 5181 Passed, 71 Skipped, 2m 33.22s Total Time |
BenchmarksBenchmark execution time: 2025-01-15 19:18:11 Comparing candidate commit 2cfb7b3 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 59 metrics, 0 unstable metrics. |
mtoffl01
left a comment
There was a problem hiding this comment.
Did a light review with some comments - go ahead and address those and then I can take a second pass!
Co-authored-by: Mikayla Toffler <[email protected]>
| // GetAll returns a **copy** of all baggage items in the context, | ||
| func GetAll(ctx context.Context) map[string]string { |
There was a problem hiding this comment.
Feel free to ignore the following: although GetAll is clear enough, I feel a more idiomatic naming would be All - like in slices.All - or Items/Entries - for which I don't have any example in the stdlib but it could be aligned with Values present in multiple stdlib packages.
Anyway, I'm approving this as is.
@mtoffl01 WDYT about the current API?
There was a problem hiding this comment.
Might be confusing because the function lives on a package called tracer; if we moved baggage into its own package, then we could do baggage.All.
Actually GetAll is still ambiguous on the tracer package; what about renaming it to AllBaggage? Either that, or move all this code into a package called baggage, and then rename the function to All
There was a problem hiding this comment.
The code has been moved to a separate package called baggage! Now lives under ddtrace and not tracer.
There was a problem hiding this comment.
I'm still seeing package tracer at the top; should be package baggage, right?
There was a problem hiding this comment.
ah! just saw it and updated it
Co-authored-by: Mikayla Toffler <[email protected]>
What does this PR do?
Adding baggage API. This is the first PR to add baggage functionality to dd-trace-go and only adds the public API methods.
Motivation
Reviewer's Checklist
v2-devbranch and reviewed by @DataDog/apm-go.Unsure? Have a question? Request a review!