-
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
Metrics: Support for updating/adding the metrics label names/values from metric name regex groups #24366
Comments
Pinging code owners for processor/metricstransform: @dmitryax. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hello @dirrao, sorry for the delay in response! Can you provide some more information for your goal here? A specific example of what you're trying to match and do with the processor would be a lot of help in directing your concern here. |
@dirrao Thanks for raising this request. I have a similar reqeust, but I'm not sure if this is your case. @crobert-1 This is my case. I tried to use statsdreciever + metricstransform to cover some statad metrics that don't have label and value. stats metrics
The configuration that I have for metricstransform. I can add regex group to metric name, but I'm not able to make it work in new label. This works in metric name
This doesn't work. The regex group won't able to add in label value.
|
Or we have to user another processor module to achieve this goal? |
I believe you may be able to use the transform processor here to add an attribute with the proper value from the metric name. The transform processor uses the OpenTelemetry Transformation Language (OTTL) to transform telemetry. I believe if you set the context to be DataPoint, you'd have access to both the datapoint attributes, and the metric name. The ExtractPatterns OTTL function could be used to extract the status code into a map from the metric name, and then you could use the set function with the proper status (from If you want to also rename metric names to remove the status code, you could also include the metric transform in your pipeline to rename metrics and remove the status from their names after the attribute is added. Terminology note: |
Pinging code owners for processor/transform: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Pinging code owners for processor/metricstransform: @dmitryax. See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@crobert-1 That's really good information! I'll give a try. |
@crobert-1 Thanks for your suggestion! This works perfectly! |
Perfect! I'm going to close this issue, but feel free to let us know if there's anything else we can do to help! |
I wanted to include a solution to this issue using the transform processor. this example extracts a UUID from the metric name, adds it to the attributes with a named group, and then removes the uuid from the metric name:
|
Component(s)
No response
Is your feature request related to a problem? Please describe.
Unable to use metrics regex groups in label names or values in metrics transform processor. It will be great to add this to avoid blowing the metrics namespace. We are looking something similar to statsd telegraf templates.
https://github.com/influxdata/telegraf/blob/master/plugins/inputs/statsd/README.md
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: