Skip to content

feat: Add OTAP metric-name filtering support#2777

Open
ThomsonTan wants to merge 4 commits intoopen-telemetry:mainfrom
ThomsonTan:add_metric_filter
Open

feat: Add OTAP metric-name filtering support#2777
ThomsonTan wants to merge 4 commits intoopen-telemetry:mainfrom
ThomsonTan:add_metric_filter

Conversation

@ThomsonTan
Copy link
Copy Markdown
Contributor

Change Summary

Adds metric-name filtering to the OTAP filter processor and documents how to configure it.

What issue does this PR close?

The filter exists for traces/logs signal, but remains TODO for metrics.

  • Closes #NNN

How are these changes tested?

Added test and passed locally.

Are there any user-facing changes?

@github-actions github-actions Bot added the rust Pull requests that update Rust code label Apr 29, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 93.19728% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.06%. Comparing base (b911578) to head (46e263c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2777      +/-   ##
==========================================
+ Coverage   86.04%   86.06%   +0.01%     
==========================================
  Files         704      705       +1     
  Lines      264654   264946     +292     
==========================================
+ Hits       227719   228014     +295     
+ Misses      36411    36408       -3     
  Partials      524      524              
Components Coverage Δ
otap-dataflow 87.00% <93.19%> (+0.01%) ⬆️
query_abstraction 80.61% <ø> (ø)
query_engine 90.76% <ø> (ø)
otel-arrow-go 52.45% <ø> (ø)
quiver 92.25% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ThomsonTan ThomsonTan marked this pull request as ready for review May 4, 2026 21:41
@ThomsonTan ThomsonTan requested a review from a team as a code owner May 4, 2026 21:41
) -> Result<(OtapArrowRecords, u64, u64)> {
let payload_type = metrics_payload.root_payload_type();
let metrics = metrics_payload
.root_record_batch()
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 believe this should handle an empty metrics payload before requiring the root record batch. Empty OTLP metrics requests encode to Metrics::default() with no UnivariateMetrics batch, so a pipeline with the default no-op metric filter would now fail with RecordBatchNotFound instead of passing the empty batch through.

};

let filtered_count = num_rows - metric_filter.true_count() as u64;
let filtered = filter_otap_batch(&metric_filter, &metrics_payload, pool)?;
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.

Can we add one direct OTAP test for this cascade? The current tests prove the round-tripped OTLP metrics look right, but they do not directly show that child batches like data points, exemplars, and attrs are pruned when a metric is removed. A small assertion on the child batch row counts would make this path much safer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants