Add trace filter tests [APMSP-2763]#6952
Conversation
|
|
… 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>
# 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>
🎉 All green!🧪 All tests passed 🔗 Commit SHA: 85ab44e | Docs | Datadog PR Page | Give us feedback! |
💡 Codex ReviewThis helper is called from the new system-tests/tests/test_the_test/scenarios.json Lines 5641 to 5643 in 2e3ce18
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
97052c0 to
1a7794c
Compare
| """A require filter drops traces whose root span lacks the required tag.""" | ||
| with test_library, test_library.dd_start_span(name="web.request"): | ||
| pass | ||
| assert not test_agent.traces(), "trace lacking the required tag should be dropped" |
There was a problem hiding this comment.
nit: why not check for stats here ?
There was a problem hiding this comment.
These tests are focused on trace filters specifically, so they should not fail if CSS has a problem.
When I tried checking stats here using php it failed for the same reason as why CSS tests are disabled for php:
missing_feature (CSS v1.2.0: dd-trace-php ships CSS since v1.19.0, but the sidecar stats exporter retains buckets younger than ~20s (buffer_len=2 * bucket_size=10s) and dd_trace_synchronous_flush passes force=false, so short-lived parametric tests never observe a /v0.6/stats request)
cbeauchesne
left a comment
There was a problem hiding this comment.
From framework usage, all good.
I let someone familiar with the feature validate the test logic and approve the PR
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(maybe in a follow up PR, this is an edge-edge case)Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present