Uh oh!
There was an error while loading. Please reload this page.
feat: support metric name filtering in OpenTelemetry exporter - #2344
Conversation
Signed-off-by: subhramit <subhramit.bb@live.in>
subhramit
commented
Jul 25, 2026
cc @zeitlinger :) |
zeitlinger
left a comment
There was a problem hiding this comment.
The filtering implementation is consistent with PrometheusScrapeHandler: it builds the same MetricNameFilter from all four ExporterFilterProperties fields and uses registry.scrape(predicate). I ran the exporter module test reactor locally and it passed (including all 35 exporter-module tests). The two new tests cover exact-name exclusion and allowed-prefix filtering; please also add coverage through the user-facing configuration path (OtelAutoConfig) rather than only constructing PrometheusMetricProducer directly, so the wiring itself is protected against regression.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: subhramit <subhramit.bb@live.in>
Signed-off-by: subhramit <subhramit.bb@live.in>
subhramit
commented
Jul 27, 2026
This is also added now. |
zeitlinger
left a comment
There was a problem hiding this comment.
Could you add a short note to docs/content/otel/otlp.md that the OpenTelemetry exporter now honors the shared io.prometheus.exporter.filter.* metric-name filter properties, with a link to the existing “Exporter Filter Properties” section in docs/content/config/config.md? The property keys are already documented there, so a separate page is not needed.
Signed-off-by: subhramit <subhramit.bb@live.in>
subhramit
commented
Jul 27, 2026
Added. |
zeitlinger
left a comment
There was a problem hiding this comment.
Thanks for addressing the builder API, end-to-end wiring test, and documentation. The filtering behavior now matches the existing scrape-handler path, and CI is green.
Thanks for the contribution! |
Closes the last pending high-priority item in #1816 (as all others have already been addressed).
Currently,
PrometheusMetricProduceralways exported all metrics in the registry unconditionally. The code already had a TODO sketching how filtering could be added:client_java/prometheus-metrics-exporter-opentelemetry/src/main/java/io/prometheus/metrics/exporter/opentelemetry/PrometheusMetricProducer.java
Lines 47 to 54 in 9432fdc
this PR implements that by reusing
ExporterFilterPropertiesandMetricNameFilter, as already done byPrometheusScrapeHandler.As a result, the OpenTelemetry exporter now honors the shared
io.prometheus.exporter.filter.*configuration, making its behavior consistent with the HTTP/Servlet exporters.