feat: Add OTAP metric-name filtering support#2777
feat: Add OTAP metric-name filtering support#2777ThomsonTan wants to merge 4 commits intoopen-telemetry:mainfrom
Conversation
Codecov Report❌ Patch coverage is 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
🚀 New features to boost your workflow:
|
| ) -> Result<(OtapArrowRecords, u64, u64)> { | ||
| let payload_type = metrics_payload.root_payload_type(); | ||
| let metrics = metrics_payload | ||
| .root_record_batch() |
There was a problem hiding this comment.
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)?; |
There was a problem hiding this comment.
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.
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.
How are these changes tested?
Added test and passed locally.
Are there any user-facing changes?