Skip to content

chore: use libdatadog's trace filter implementation#3986

Merged
Eldolfin merged 8 commits into
masterfrom
oscarld/use-libdatadog-trace-filter-implementation
Jun 17, 2026
Merged

chore: use libdatadog's trace filter implementation#3986
Eldolfin merged 8 commits into
masterfrom
oscarld/use-libdatadog-trace-filter-implementation

Conversation

@Eldolfin

@Eldolfin Eldolfin commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

Removes the current trace filter implementation and use libdatadog's implementation instead which more closely matches the agent's behavior.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@Eldolfin Eldolfin force-pushed the oscarld/use-libdatadog-trace-filter-implementation branch from 5be0f9c to 64c0891 Compare June 15, 2026 19:24
@Eldolfin Eldolfin requested review from bwoebi and Copilot June 15, 2026 19:24
@Eldolfin Eldolfin changed the title chore: use libdatadog trace filter implementation chore: use libdatadog's trace filter implementation Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR replaces the project’s custom trace-filtering logic with libdatadog’s TraceFilterer implementation to better match agent behavior, and updates the C/Rust FFI surface accordingly.

Changes:

  • Swap components-rs/trace_filter.rs from an in-tree regex/tag filter implementation to libdd_trace_utils::trace_filter::TraceFilterer.
  • Remove the slow-path meta-iterator callback from the FFI API and update call sites and headers.
  • Update agent-info config plumbing to pass the filter lists into the concentrator config application.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tracer/trace_filter.c Updates the C-side call into ddog_check_stats_trace_filter to the new signature (no iterator).
components-rs/trace_filter.rs Replaces custom filter compilation/evaluation with TraceFilterer and adapts the span lookup interface.
components-rs/datadog.h Updates the exported C header signature/documentation for ddog_check_stats_trace_filter.
components-rs/common.h Removes the no-longer-used meta-iteration callback typedefs from the public header.
components-rs/agent_info.rs Adjusts how filter config fields are extracted and passed into apply_concentrator_config.
Cargo.lock Adds a new Rust dependency entry related to trace normalization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tracer/trace_filter.c
Comment thread components-rs/trace_filter.rs
Comment thread components-rs/trace_filter.rs Outdated
@datadog-prod-us1-5

datadog-prod-us1-5 Bot commented Jun 15, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 8 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | ASAN test_c with multiple observers: [8.3]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | test_web_codeigniter_31: [7.4, cgi-fcgi]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | test_web_custom: [7.4, fpm-fcgi]   View in Datadog   GitLab

View all 8 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 54.08% (-0.04%)

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Jun 15, 2026

Copy link
Copy Markdown

Benchmarks [ tracer ]

Benchmark execution time: 2026-06-17 12:26:08

Comparing candidate commit 2854817 in PR branch oscarld/use-libdatadog-trace-filter-implementation with baseline commit 941af06 in branch master.

Found 1 performance improvements and 0 performance regressions! Performance is the same for 192 metrics, 1 unstable metrics.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:MessagePackSerializationBench/benchMessagePackSerialization

  • 🟩 execution_time [-4.195µs; -2.685µs] or [-4.015%; -2.570%]

@Eldolfin Eldolfin force-pushed the oscarld/use-libdatadog-trace-filter-implementation branch from f2f8524 to 5e87040 Compare June 16, 2026 10:06
@Eldolfin Eldolfin force-pushed the oscarld/use-libdatadog-trace-filter-implementation branch from 4b5f179 to 2854817 Compare June 17, 2026 11:09
@Eldolfin Eldolfin marked this pull request as ready for review June 17, 2026 12:28
@Eldolfin Eldolfin requested review from a team as code owners June 17, 2026 12:28
@Eldolfin Eldolfin requested review from greghuels and leoromanovsky and removed request for a team June 17, 2026 12:28
@Eldolfin Eldolfin merged commit 36d5401 into master Jun 17, 2026
2127 of 2138 checks passed
@Eldolfin Eldolfin deleted the oscarld/use-libdatadog-trace-filter-implementation branch June 17, 2026 12:29
@github-actions github-actions Bot added this to the 1.22.0 milestone Jun 17, 2026
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