Skip to content

Add test for service source field on trace stats#6565

Open
amarziali wants to merge 8 commits intomainfrom
andrea.marziali/stats-service-override
Open

Add test for service source field on trace stats#6565
amarziali wants to merge 8 commits intomainfrom
andrea.marziali/stats-service-override

Conversation

@amarziali
Copy link
Contributor

Motivation

This PR adds system tests to verify that tracers correctly set the service name override source field (srv_src in stats buckets) when a DD integration overrides the service name.

This is currently enforced only in java.

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?

@amarziali amarziali requested review from a team as code owners March 23, 2026 10:00
@amarziali amarziali requested review from christophe-papazian, taegyunkim and zacharycmontoya and removed request for a team March 23, 2026 10:00
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

CODEOWNERS have been resolved as:

manifests/cpp.yml                                                       @DataDog/dd-trace-cpp
manifests/cpp_httpd.yml                                                 @DataDog/dd-trace-cpp
manifests/cpp_nginx.yml                                                 @DataDog/dd-trace-cpp
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/java_otel.yml                                                 @DataDog/system-tests-core
manifests/nodejs.yml                                                    @DataDog/dd-trace-js
manifests/nodejs_otel.yml                                               @DataDog/system-tests-core
manifests/php.yml                                                       @DataDog/apm-php @DataDog/asm-php
manifests/python.yml                                                    @DataDog/apm-python @DataDog/asm-python
manifests/python_lambda.yml                                             @DataDog/apm-python @DataDog/asm-python
manifests/python_otel.yml                                               @DataDog/apm-python @DataDog/asm-python
manifests/ruby.yml                                                      @DataDog/ruby-guild @DataDog/asm-ruby
manifests/rust.yml                                                      @DataDog/apm-rust
tests/schemas/utils/agent/api/v0.2/stats-request.json                   @DataDog/system-tests-core
tests/schemas/utils/library/v0.6/stats-request.json                     @DataDog/system-tests-core
tests/stats/test_stats.py                                               @DataDog/system-tests-core

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: 224ed3c8aa

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@datadog-prod-us1-5
Copy link

datadog-prod-us1-5 bot commented Mar 23, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 36 Tests failed

tests.ffe.test_flag_eval_metrics.Test_FFE_Eval_Metric_Basic.test_ffe_eval_metric_basic[chi] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: Expected at least one feature_flag.evaluations metric for flag 'eval-metric-basic-flag', but found none. All eval metrics: []
assert 0 > 0
 +  where 0 = len([])

self = <tests.ffe.test_flag_eval_metrics.Test_FFE_Eval_Metric_Basic object at 0x7f98fcdd4dd0>

    def test_ffe_eval_metric_basic(self):
        """Test that flag evaluation produces a metric with correct tags."""
        assert self.r.status_code == 200, f"Flag evaluation failed: {self.r.text}"
    
...
tests.ffe.test_flag_eval_metrics.Test_FFE_Eval_Metric_Basic.test_ffe_eval_metric_basic[echo] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: Expected at least one feature_flag.evaluations metric for flag 'eval-metric-basic-flag', but found none. All eval metrics: []
assert 0 > 0
 +  where 0 = len([])

self = <tests.ffe.test_flag_eval_metrics.Test_FFE_Eval_Metric_Basic object at 0x7fbc205015e0>

    def test_ffe_eval_metric_basic(self):
        """Test that flag evaluation produces a metric with correct tags."""
        assert self.r.status_code == 200, f"Flag evaluation failed: {self.r.text}"
    
...
tests.ffe.test_flag_eval_metrics.Test_FFE_Eval_Metric_Basic.test_ffe_eval_metric_basic[gin] from system_tests_suite   View in Datadog   (Fix with Cursor)
AssertionError: Expected at least one feature_flag.evaluations metric for flag 'eval-metric-basic-flag', but found none. All eval metrics: []
assert 0 > 0
 +  where 0 = len([])

self = <tests.ffe.test_flag_eval_metrics.Test_FFE_Eval_Metric_Basic object at 0x7f7c3c205970>

    def test_ffe_eval_metric_basic(self):
        """Test that flag evaluation produces a metric with correct tags."""
        assert self.r.status_code == 200, f"Flag evaluation failed: {self.r.text}"
    
...
View all

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 902a24d | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@amarziali amarziali requested review from a team as code owners March 23, 2026 13:44
tests/stats/test_stats.py: v1.54.0
tests/stats/test_stats.py::Test_Client_Drop_P0s::test_client_drop_p0s_false: v2.6.0
tests/stats/test_stats.py::Test_Client_Stats::test_grpc_status_code: irrelevant (variant has no gRPC endpoint)
tests/stats/test_stats.py::Test_Stats_Service_Source: irrelevant (Only implemented for Java)
Copy link
Member

Choose a reason for hiding this comment

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

it's implemented now in go and merged in main, but can be done later

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