Skip to content

test(debugger): add snapshot-correlation gate and Go weblog endpoints - #7425

Open
grantseltzer wants to merge 1 commit into
mainfrom
grantseltzer/correlation-tests-go
Open

test(debugger): add snapshot-correlation gate and Go weblog endpoints#7425
grantseltzer wants to merge 1 commit into
mainfrom
grantseltzer/correlation-tests-go

Conversation

@grantseltzer

Copy link
Copy Markdown
Member

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

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/debugger/test_debugger_snapshot_correlation.py                    @DataDog/debugger @DataDog/system-tests-core
tests/debugger/utils/probes/probe_snapshot_log_correlation.json         @DataDog/debugger @DataDog/system-tests-core
tests/debugger/utils/probes/probe_snapshot_log_correlation_loop.json    @DataDog/debugger @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/debugger/test_debugger_probe_budgets.py                           @DataDog/debugger @DataDog/system-tests-core
tests/debugger/utils.py                                                 @DataDog/debugger @DataDog/system-tests-core
utils/_features.py                                                      @DataDog/system-tests-core
utils/build/docker/golang/app/chi/debugger.go                           @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/app/chi/main.go                               @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/app/echo/debugger.go                          @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/app/echo/main.go                              @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/app/gin/debugger.go                           @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/app/gin/main.go                               @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/app/net-http-orchestrion/debugger.go          @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/app/net-http-orchestrion/main.go              @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/app/net-http/debugger.go                      @DataDog/dd-trace-go-guild @DataDog/system-tests-core
utils/build/docker/golang/app/net-http/main.go                          @DataDog/dd-trace-go-guild @DataDog/system-tests-core

@grantseltzer
grantseltzer marked this pull request as ready for review August 3, 2026 13:58
@grantseltzer
grantseltzer requested review from a team as code owners August 3, 2026 13:58
@grantseltzer
grantseltzer requested review from dromanol, florentinl, manuel-alvarez-alvarez and ncybul and removed request for a team August 3, 2026 13:58

@datadog-datadog-prod-us1 datadog-datadog-prod-us1 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Datadog Autotest: PASS

More details

The new correlation chain returns the expected value, and the loop handler safely returns Loop 0 for both zero and negative counts. The shared line-probe mapping targets the newly added loop body and sibling lines consistently across Go weblog variants.

Was this helpful? React 👍 or 👎

📊 Validated against 3 scenarios · Open Bits AI session

🤖 Datadog Autotest · Commit 8431afa · What is Autotest? · @DataDog review to ask questions · Any feedback? Reach out in #autotest

@nccatoni nccatoni left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM (from @DataDog/system-tests-core) but you should get a review from someone familiar with the feature

@scenarios.debugger_probes_snapshot
@slow
class Test_Debugger_Coordinated_Sampling(debugger.BaseDebuggerTest):
"""Tier 1: the sampling decision is made once per trace and applies to every probe that

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this docstring is providing a lot of value on the test suite

for probe in probes:
probe["id"] = debugger.generate_probe_id("log")
# Use the tracer's existing per-probe sampling config to sample below 100%.
probe["sampling"] = {"snapshotsPerSecond": _SNAPSHOTS_PER_SECOND}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why do we need to configure this?

@grantseltzer grantseltzer Aug 7, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

If you meant to point at dynamic_sampling_enabled=True that shouldn't have been added and I removed that change.

For this one, the test asserts at least one trace was fully dropped.


from utils import scenarios, features, slow

# Snapshot rate for the correlation probes, set through the tracer's existing per-probe sampling

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do these constants need comments explaining them? I think the reader can infer what _SNAPSHOTS_PER_SECOND is...



def _trace_id(snapshot: dict) -> str | None:
return snapshot.get("dd", {}).get("trace_id")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why does this need a helper?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It does not, removed

@features.debugger_probe_budgets
@scenarios.debugger_probes_snapshot
@slow
class Test_Debugger_Per_Span_Budget(debugger.BaseDebuggerTest):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does it really make sense to break these into separate classes?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nope. Fixed.

@@ -0,0 +1,267 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the the Apache License Version 2.0.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2021 Datadog, Inc.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should be 2026- is this needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's 2021 everywhere in this repo, are you sure it should be 26?

@grantseltzer
grantseltzer force-pushed the grantseltzer/correlation-tests-go branch from 8431afa to 86f3832 Compare August 7, 2026 22:06
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 7, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 6 Pipeline jobs failed

Testing the test | System Tests (php, dev) / End-to-end #2 / laravel11x 2   View in Datadog   GitHub Actions

🧪 1 Test failed

tests.stats.test_stats.Test_Peer_Tags.test_peer_tags[laravel11x] from system_tests_suite   View in Datadog
AssertionError: Client spans should have peer tags, found: []
assert 0 > 0
 +  where 0 = len([])

self = <tests.stats.test_stats.Test_Peer_Tags object at 0x7faa45fc2000>

    def test_peer_tags(self):
        """Test that client spans include peer tags while server spans don't"""
        client_stats_found = False
        server_stats_found = False
...

DataDog/system-tests | K8S_LIB_INJECTION_PROFILING_OVERRIDE: [dd-lib-java-init-test-app, ${PRIVATE_DOCKER_REGISTRY}/system-tests/dd-lib-java-init-test-app, 235494822917.dkr.ecr.us-east-1.amazonaws.com/ssi/cluster-agent:7.81.0, 235494822917.dkr.ecr.us-east-1.amazonaws.com/ssi/apm-inject:latest, 3.231.1, 235494822917.dkr.ecr.us-east-1.amazonaws.com/ssi/dd-lib-java-init:latest_snapshot]   View in Datadog   GitLab

DataDog/system-tests | K8S_LIB_INJECTION_PROFILING_OVERRIDE: [dd-lib-java-init-test-app, ${PRIVATE_DOCKER_REGISTRY}/system-tests/dd-lib-java-init-test-app, 235494822917.dkr.ecr.us-east-1.amazonaws.com/ssi/cluster-agent:7.81.0, 235494822917.dkr.ecr.us-east-1.amazonaws.com/ssi/apm-inject:latest_snapshot, 3.231.1, 235494822917.dkr.ecr.us-east-1.amazonaws.com/ssi/dd-lib-java-init:latest_snapshot]   View in Datadog   GitLab

View all 6 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 86f3832 | Docs | Datadog PR Page | Give us feedback!

@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Aug 7, 2026

Copy link
Copy Markdown

Bits found no code fix to apply

🟢 Investigated · ⚪ No code fix needed

K8S_LIB_INJECTION_PROFILING_OVERRIDE fails in the unchanged Java/Kubernetes profiling path: the profiler cannot start on the Alpine JVM because libgcc_s.so.1 is missing, and companion jobs lose access to the Kubernetes API server. No code change was made because the debugger tests and Go weblog endpoint additions do not execute or configure that path.


View in Datadog | Reviewed commit 86f3832 · Any feedback? Reach out in #deveng-pr-agent

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.

3 participants