Skip to content

Use a better API to handle agent trace polymorphism#6370

Merged
cbeauchesne merged 9 commits intomainfrom
cbeauchesne/v1-format-leftovers
Feb 26, 2026
Merged

Use a better API to handle agent trace polymorphism#6370
cbeauchesne merged 9 commits intomainfrom
cbeauchesne/v1-format-leftovers

Conversation

@cbeauchesne
Copy link
Collaborator

Motivation

Changes

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

  • Anything but tests/ or manifests/ is modified ? 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, removed or renamed?

@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

CODEOWNERS have been resolved as:

utils/dd_types/_datadog_agent_trace.py                                  @DataDog/system-tests-core
tests/ai_guard/test_ai_guard_sdk.py                                     @DataDog/k9-ai-guard @DataDog/system-tests-core
tests/apm_tracing_e2e/test_otel.py                                      @DataDog/system-tests-core
tests/apm_tracing_e2e/test_process_tags.py                              @DataDog/system-tests-core
tests/apm_tracing_e2e/test_single_span.py                               @DataDog/system-tests-core
tests/appsec/rasp/test_api10.py                                         @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_asm_standalone.py                                     @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_automated_login_events.py                             @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_automated_payment_events.py                           @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_blocking_addresses.py                                 @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_client_ip.py                                          @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_conf.py                                               @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_event_tracking.py                                     @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_event_tracking_v2.py                                  @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_identify.py                                           @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_inferred_spans.py                                     @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_remote_config_rule_changes.py                         @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_reports.py                                            @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_shell_execution.py                                    @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_span_tags_headers.py                                  @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_trace_tagging.py                                      @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_traces.py                                             @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/test_user_blocking_full_denylist.py                        @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/waf/test_addresses.py                                      @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/waf/test_blocking.py                                       @DataDog/asm-libraries @DataDog/system-tests-core
tests/appsec/waf/test_reports.py                                        @DataDog/asm-libraries @DataDog/system-tests-core
tests/debugger/test_debugger_code_origins.py                            @DataDog/debugger @DataDog/system-tests-core
tests/debugger/test_debugger_exception_replay.py                        @DataDog/debugger @DataDog/system-tests-core
tests/debugger/utils.py                                                 @DataDog/debugger @DataDog/system-tests-core
tests/integrations/crossed_integrations/test_kafka.py                   @DataDog/system-tests-core
tests/integrations/crossed_integrations/test_kinesis.py                 @DataDog/system-tests-core
tests/integrations/crossed_integrations/test_rabbitmq.py                @DataDog/system-tests-core
tests/integrations/crossed_integrations/test_sns_to_sqs.py              @DataDog/system-tests-core
tests/integrations/crossed_integrations/test_sqs.py                     @DataDog/system-tests-core
tests/integrations/test_db_integrations_sql.py                          @DataDog/system-tests-core
tests/integrations/test_dbm.py                                          @DataDog/system-tests-core
tests/integrations/test_inferred_proxy.py                               @DataDog/system-tests-core
tests/integrations/test_open_telemetry.py                               @DataDog/system-tests-core
tests/integrations/utils.py                                             @DataDog/system-tests-core
tests/serverless/span_pointers/utils.py                                 @DataDog/serverless @DataDog/system-tests-core
tests/test_config_consistency.py                                        @DataDog/system-tests-core
tests/test_data_integrity.py                                            @DataDog/system-tests-core
tests/test_distributed.py                                               @DataDog/system-tests-core
tests/test_graphql.py                                                   @DataDog/system-tests-core
tests/test_identify.py                                                  @DataDog/system-tests-core
tests/test_library_conf.py                                              @DataDog/system-tests-core
tests/test_protobuf.py                                                  @DataDog/system-tests-core
tests/test_sampling_rates.py                                            @DataDog/system-tests-core
tests/test_scrubbing.py                                                 @DataDog/system-tests-core
tests/test_semantic_conventions.py                                      @DataDog/system-tests-core
tests/test_telemetry.py                                                 @DataDog/libdatadog-telemetry @DataDog/apm-sdk-capabilities @DataDog/system-tests-core
tests/test_v1_payloads.py                                               @DataDog/system-tests-core
utils/dd_constants.py                                                   @DataDog/system-tests-core
utils/dd_types/__init__.py                                              @DataDog/system-tests-core
utils/interfaces/_agent.py                                              @DataDog/system-tests-core
utils/interfaces/_library/appsec.py                                     @DataDog/system-tests-core
utils/interfaces/_library/core.py                                       @DataDog/system-tests-core
utils/tools.py                                                          @DataDog/system-tests-core
utils/dd_types/_datadog_library_trace.py                                @DataDog/system-tests-core

@datadog-datadog-prod-us1

This comment has been minimized.

@cbeauchesne cbeauchesne marked this pull request as ready for review February 26, 2026 11:58
@cbeauchesne cbeauchesne requested review from a team as code owners February 26, 2026 11:58
@cbeauchesne cbeauchesne requested review from mcculls and paullegranddc and removed request for a team February 26, 2026 11:58
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a1a2fabc4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".


link = span_links[0]
trace_id_high, trace_id_low = _get_span_link_trace_id(link, span_links_format)
trace_id_high, trace_id_low = _get_span_link_trace_id(link, span.trace.format)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve span-link payload format when decoding IDs

When retrieve_span_links falls back to _dd.span_links, it converts links to legacy-style numeric fields (traceID/traceIDHigh as int), but this call now always passes span.trace.format into _get_span_link_trace_id. In runs where the trace is efficient format but span links are still emitted via _dd.span_links (the fallback branch in this same helper), _get_span_link_trace_id takes the efficient path and executes int(link["traceID"], 16), which fails because link["traceID"] is already an integer. This breaks the extract-behavior span-link assertions for mixed-format inputs.

Useful? React with 👍 / 👎.

@cbeauchesne cbeauchesne merged commit e381dd5 into main Feb 26, 2026
3396 of 3399 checks passed
@cbeauchesne cbeauchesne deleted the cbeauchesne/v1-format-leftovers branch February 26, 2026 12:09
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.

1 participant