Skip to content

Conversation

@zacharycmontoya
Copy link
Contributor

@zacharycmontoya zacharycmontoya commented Nov 7, 2025

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

  • Adds the following test classes in test_baggage.py:
    • Test_Baggage_Headers_Api_Datadog (asserts the Datadog W3C Baggage APIs, where applicable)
    • Test_Baggage_Headers_Api_OTel (asserts the OTel Baggage APIs, where applicable)
  • Implements the new required endpoints /otel_drop_in_baggage_api_otel and /otel_drop_in_baggage_api_datadog, which have the following behavior:
    • Accepts query params url, baggage_set, and baggage_remove
    • The endpoints use the corresponding API to do the following:
      • Call Baggage.Remove for each item in the baggage_remove param, then
      • Call Baggage.Add for each item in the baggage_set param, then
      • Duplicate the /make_distant_call endpoint logic to send a downstream HTTP request and return request/response information

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

…nTelemetry Baggage API to modify the automatically propagated W3C Baggage header
@github-actions
Copy link
Contributor

github-actions bot commented Nov 7, 2025

CODEOWNERS have been resolved as:

manifests/cpp_httpd.yml                                                 @DataDog/system-tests-core
manifests/cpp_nginx.yml                                                 @DataDog/system-tests-core
manifests/dotnet.yml                                                    @DataDog/apm-dotnet @DataDog/asm-dotnet
manifests/golang.yml                                                    @DataDog/dd-trace-go-guild
manifests/java.yml                                                      @DataDog/asm-java @DataDog/apm-java
manifests/nodejs.yml                                                    @DataDog/dd-trace-js
manifests/php.yml                                                       @DataDog/apm-php @DataDog/asm-php
manifests/python.yml                                                    @DataDog/apm-python @DataDog/asm-python
manifests/ruby.yml                                                      @DataDog/ruby-guild @DataDog/asm-ruby
tests/test_baggage.py                                                   @DataDog/system-tests-core
utils/build/docker/dotnet/weblog/Endpoints/OtelDropInEndpoint.cs        @DataDog/apm-dotnet @DataDog/asm-dotnet @DataDog/system-tests-core
utils/build/docker/java/spring-boot/src/main/java/com/datadoghq/system_tests/springboot/App.java  @DataDog/apm-java @DataDog/asm-java @DataDog/system-tests-core
utils/build/docker/nodejs/fastify/app.js                                @DataDog/dd-trace-js @DataDog/system-tests-core
utils/build/docker/python/flask/app.py                                  @DataDog/apm-python @DataDog/asm-python @DataDog/system-tests-core
utils/build/docker/ruby/README.md                                       @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails72/app/controllers/system_test_controller.rb  @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core
utils/build/docker/ruby/rails72/config/routes.rb                        @DataDog/ruby-guild @DataDog/asm-ruby @DataDog/system-tests-core

Copy link
Contributor

@PerfectSlayer PerfectSlayer left a 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 {
Copy link
Contributor

@mcculls mcculls Nov 12, 2025

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:

Suggested change
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 :)

Copy link
Contributor

@mcculls mcculls left a 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

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.

5 participants