-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Automatic metric relabel to append _total to metric name #37510
Comments
Pinging code owners for receiver/prometheus: @Aneurysm9 @dashpole. See Adding Labels via Comments if you do not have permissions to add labels yourself. For example, comment '/label priority:p2 -needs-triaged' to set the priority and remove the needs-triaged label. |
Thats very strange. The metricstransform processor should definitely work, and the metric_relabel_configs should also work. The prometheus receiver doesn't actually add any suffixes itself, but if you are scraping using OpenMetrics, some client libraries will automatically add the total suffix. You verified that the metric name in the debug exporter still had the _total suffix, right? |
There was no |
I suspect the OTLP receiver for grafana is adding the suffix. That would make sense if they are using the Prometheus OTLP endpoint (which adds suffixes) in their agent or product. |
See https://github.com/prometheus/prometheus/blob/6ede9005066a9f8b6ace1f9b3e215c208e60c3bd/docs/configuration/configuration.md?plain=1#L185. All current options add suffixes. We are working on adding support for a suffix-less option. |
Thanks @dashpole that helps a lot. Since we have Grafana support, I will attempt to bring this to their notice. I find forcefully changing the metric name should be registered as a breaking change. It means changing alerts and dashboards that use that metric name. |
Component(s)
prometheus receiver
What happened?
I am using the latest version of OTel with K8s. It seems that the prometheus receiver automatically appends
_total
to the metric name for metrics of typecounter
.I wanted to keep my original metric name and it seems almost impossible to undo the automatic renaming of the metric. I tried setting
trim_metric_suffixes: true
but it doesn't seem to work.I tried
metric_relabel_configs
which also didn't seem to work with the prometheus receiverI even tried the
metricstransform
processor which also did not work.How can I keep the original metric name?
Collector version
0.118.0
Environment information
GKE K8S version 1.30
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: