-
Notifications
You must be signed in to change notification settings - Fork 441
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
WIP: Datadog Baggage API #3069
WIP: 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a light review with some comments - go ahead and address those and then I can take a second pass!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Just be sure to check why TestWrapConsumerGroupHandler is failing and update it if necessary.
Co-authored-by: Mikayla Toffler <[email protected]>
ddtrace/baggage/baggage.go
Outdated
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still seeing package tracer
at the top; should be package baggage
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-dev
branch and reviewed by @DataDog/apm-go.Unsure? Have a question? Request a review!