-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Filtering metrics by label/attribute (via regex) #36038
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hi @LilWatson! I'm currently trying to reproduce this behaviour, however it seems like the regex filter is correctly applied in my case (using the same configuration). May I ask you to also post the payload of the prometheus endpoint, i.e. of the Regarding the support of the regexp match type: These config options are apparently still supported (I checked the code and they are still included in the config structs and considered in the filtering logic), but according to the docs https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/v0.96.0/processor/filterprocessor/README.md#alternative-config-options these will be deprecated and the recommended way will be to use OTTL expressions - for this use case, the IsMatch function might be suited - I will try to put together a config example for this :) |
So here would be the filter configuration using the
This should exclude all resource metrics where the |
Component(s)
processor/filter
What happened?
Description
My original goal was to include only metrics with the label namespace starting with a given string. Since this did not work i tried filtering with a static string, which also gave me problems.
Steps to Reproduce
kind create cluster
install mimir (chart default values)
install kube-state-metrics exporter (chart default values)
Expected Result
The original config should include only metrics/timeseries with a namespace label starting with "graf".
The additional filters i have tried (see configuration section) should exclude timeseries with a namespace label set to "grafana".
Actual Result
The original config result also includes metrics/timeseries with a namespace label not starting with "graf".
The additional filters result includes timeseries with a namespace label set to "grafana".
Collector version
v0.111.0
Environment information
Environment
OS: macOS 14.0 (23A344)
OpenTelemetry Collector configuration
Log output
Additional context
The Include/Exclude filter config featuring regex examples was removed from the readme. While using it there was no configuration error nor warning message. Is this still supported? If not what is the current way to filter metric labels/attributes via regex?
Thanks in Advance! :)
The text was updated successfully, but these errors were encountered: