Skip to content

Add trace filter tests [APMSP-2763]#6952

Draft
Eldolfin wants to merge 10 commits into
mainfrom
oscarld/add-trace-filter-test
Draft

Add trace filter tests [APMSP-2763]#6952
Eldolfin wants to merge 10 commits into
mainfrom
oscarld/add-trace-filter-test

Conversation

@Eldolfin

@Eldolfin Eldolfin commented May 15, 2026

Copy link
Copy Markdown
Contributor

APMSP-2763
APMSP-3048

Motivation

Changes

Add system-tests coverage for the CSS V1.2 spec trace filters (filter_tags, filter_tags_regex, ignore_resources).

TODO

  • add resources/tags normalization test

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 May 15, 2026

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/stats/test_trace_filters.py                                       @DataDog/system-tests-core
.github/workflows/run-end-to-end.yml                                    @DataDog/system-tests-core
manifests/cpp.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/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
manifests/rust.yml                                                      @DataDog/apm-rust
tests/test_the_test/scenarios.json                                      @DataDog/system-tests-core
utils/_context/_scenarios/__init__.py                                   @DataDog/system-tests-core
utils/_context/_scenarios/endtoend.py                                   @DataDog/system-tests-core
utils/_context/containers.py                                            @DataDog/system-tests-core
utils/proxy/mocked_response.py                                          @DataDog/system-tests-core

@Eldolfin Eldolfin changed the title feat: add trace filter tests (checked on stats) feat: add trace filter tests [APMSP-2763] May 15, 2026
@Eldolfin Eldolfin changed the title feat: add trace filter tests [APMSP-2763] Add trace filter tests [APMSP-2763] May 15, 2026
gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/libdatadog that referenced this pull request May 19, 2026
… scheme (#2008)

These fields were renamed in version 7.79.0 of the agent for consistency.

# What does this PR do?

Allow both PascalCase and the newer snake_case format for these fields.

# Motivation

The trace exporter was crashing in a confusing way in new system tests I wrote for another feature: DataDog/system-tests#6952. I had an older agent.

# Additional Notes

Anything else we should know when reviewing?

# How to test the change?

Describe here in detail how the change can be validated.


Co-authored-by: oscar.ledauphin <oscar.ledauphin@datadoghq.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/libdatadog that referenced this pull request Jun 16, 2026
# What does this PR do?

Implements the CSS trace-level filtering mechanism, that is applied before stats computation.

# Motivation

It's un unmet requirement from the spec.

# Additional Notes
~Please Ctrl+F `FIXME` when reviewing, I let some questions in the code that I'd like answers for before merging~

## TODO:

- [x] unit tests
- [x] system-tests DataDog/system-tests#6952
- [x] normalization before filtering
- [x] regex keys (currently only regex values are checked)
- [x] new spec or CSS spec RFC
- [x] telemetry ? Count dropped traces with the reason
- [x] trim spaces when parsing config
- [x] Move implementation to trace-utils
- [x] stop using v4 span but generic spans instead for php
- [x] move arcswap to the trace exporter (remove update_conf)
- [x] use test agent for snapshot tests

## Wont do
- [ ] ~advanced resource normalization (sql, redis etc...).~ No other implementation does that
- [ ] ~100% normalization edge cases (empty service field + non-normalized name + filter depending on that)~ Too specific edge case. Ignoring it for now
- [ ] ~check on meta_struct too~ Not in the spec


[APMSP-2763]

[APMSP-2763]: https://datadoghq.atlassian.net/browse/APMSP-2763?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

Co-authored-by: oscar.ledauphin <oscar.ledauphin@datadoghq.com>
@datadog-official

datadog-official Bot commented Jun 17, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 138 Pipeline jobs failed

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

🧪 1 Test failed

pytest.internal[apache-mod-7.0] from system_tests_suite   View in Datadog
internal error

Traceback (most recent call last):
  File &#34;/home/runner/work/system-tests/system-tests/venv/lib/python3.12/site-packages/_pytest/main.py&#34;, line 268, in wrap_session
    session.exitstatus = doit(config, session) or 0
                         ^^^^^^^^^^^^^^^^^^^^^
  File &#34;/home/runner/work/system-tests/system-tests/venv/lib/python3.12/site-packages/_pytest/main.py&#34;, line 321, in _main
    config.hook.pytest_collection(session=session)
  File &#34;/home/runner/work/system-tests/system-tests/venv/lib/python3.12/site-packages/pluggy/_hooks.py&#34;, line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
...

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

🧪 1 Test failed

pytest.internal[apache-mod-7.0-zts] from system_tests_suite   View in Datadog
internal error

Traceback (most recent call last):
  File &#34;/home/runner/work/system-tests/system-tests/venv/lib/python3.12/site-packages/_pytest/main.py&#34;, line 268, in wrap_session
    session.exitstatus = doit(config, session) or 0
                         ^^^^^^^^^^^^^^^^^^^^^
  File &#34;/home/runner/work/system-tests/system-tests/venv/lib/python3.12/site-packages/_pytest/main.py&#34;, line 321, in _main
    config.hook.pytest_collection(session=session)
  File &#34;/home/runner/work/system-tests/system-tests/venv/lib/python3.12/site-packages/pluggy/_hooks.py&#34;, line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
...

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

🧪 1 Test failed

pytest.internal[apache-mod-7.1] from system_tests_suite   View in Datadog
internal error

Traceback (most recent call last):
  File &#34;/home/runner/work/system-tests/system-tests/venv/lib/python3.12/site-packages/_pytest/main.py&#34;, line 268, in wrap_session
    session.exitstatus = doit(config, session) or 0
                         ^^^^^^^^^^^^^^^^^^^^^
  File &#34;/home/runner/work/system-tests/system-tests/venv/lib/python3.12/site-packages/_pytest/main.py&#34;, line 321, in _main
    config.hook.pytest_collection(session=session)
  File &#34;/home/runner/work/system-tests/system-tests/venv/lib/python3.12/site-packages/pluggy/_hooks.py&#34;, line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
...

View all 138 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: 23908c8 | Docs | Datadog PR Page | Give us feedback!

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