-
Notifications
You must be signed in to change notification settings - Fork 14
Create OpenTelemetry Baggage API <> Baggage Propagation tests #5684
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
base: main
Are you sure you want to change the base?
Conversation
…nTelemetry Baggage API to modify the automatically propagated W3C Baggage header
|
|
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.
My bad, this should be fine 👌 Just fired up an IDE to confirm.
| } | ||
|
|
||
| @RequestMapping("/otel_drop_in_baggage_api_otel") | ||
| DistantCallResponse otelDropInBaggageApiOTel(@RequestParam String url, @RequestParam String baggage_remove, @RequestParam String baggage_set) throws Exception { |
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.
Tip: if you want to use camel-case in the Java code (or tweak the name in any way) you can add the parameter's snake-case name to @RequestParam:
| DistantCallResponse otelDropInBaggageApiOTel(@RequestParam String url, @RequestParam String baggage_remove, @RequestParam String baggage_set) throws Exception { | |
| DistantCallResponse otelDropInBaggageApiOTel(@RequestParam("url") String url, @RequestParam("baggage_remove") String baggageToRemove, @RequestParam("baggage_set") String baggageToSet) throws Exception { |
In this case though you're also relying on the automatic mapping when serializing DistantCallResponse which uses the same snake case for its fields, so on reflection it's not worth changing this :)
mcculls
left a comment
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.
Java changes look ok
Motivation
One use case we support is using the vendor-neutral OpenTelemetry API's to emit custom telemetry when the Datadog SDK is installed. This asserts the expected behaviors for updating propagated Baggage headers.
See APMAPI-1735
Changes
test_baggage.py:/otel_drop_in_baggage_api_oteland/otel_drop_in_baggage_api_datadog, which have the following behavior:url,baggage_set, andbaggage_removebaggage_removeparam, thenbaggage_setparam, then/make_distant_callendpoint logic to send a downstream HTTP request and return request/response informationWorkflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
[<language>], double-check that only<language>is impacted by the changebuild-XXX-imagelabel is present