Skip to content

Open Telemetry internal metrics of type "counter" emitted via prometheus exporter not comply prometheus metrics naming convention #13090

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

Open
thiruvikraman-subburaman opened this issue May 26, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@thiruvikraman-subburaman

Component(s)

exporter/exporterhelper, exporter/otlphttp, exporter/exporterqueue, extension/memorylimiter, scraper/scraperhelper

What happened?

Describe the bug
Open telemetry internal metrics now emitted via Prometheus exporter of type "counter" doesn't ends with suffix "_total" which leads to Open Telemetry internal metrics are not comply with Prometheus metrics naming conventions as per rules recommended here https://prometheus.io/docs/practices/naming/

`Note
As of Collector v0.106.1, internal metric names are handled differently based on their source:

Metrics generated from Collector components are prefixed with otelcol_.
Metrics generated from instrumentation libraries do not use the otelcol_ prefix by default, unless their metric names are explicitly prefixed.
For Collector versions prior to v0.106.1, all internal metrics emitted using the Prometheus exporter, regardless of their origin, are prefixed with otelcol_. This includes metrics from both Collector components and instrumentation libraries. `

cat metrics.txt | ./promtool check metrics --extended otelcol_exporter_send_failed_log_records counter metrics should have "_total" suffix otelcol_exporter_send_failed_spans counter metrics should have "_total" suffix otelcol_exporter_sent_log_records counter metrics should have "_total" suffix otelcol_exporter_sent_spans counter metrics should have "_total" suffix otelcol_process_cpu_seconds counter metrics should have "_total" suffix otelcol_process_runtime_total_alloc_bytes counter metrics should have "_total" suffix otelcol_process_uptime counter metrics should have "_total" suffix otelcol_processor_accepted_log_records counter metrics should have "_total" suffix otelcol_processor_accepted_spans counter metrics should have "_total" suffix otelcol_processor_batch_timeout_trigger_send counter metrics should have "_total" suffix otelcol_processor_incoming_items counter metrics should have "_total" suffix otelcol_processor_outgoing_items counter metrics should have "_total" suffix otelcol_receiver_accepted_log_records counter metrics should have "_total" suffix otelcol_receiver_accepted_spans counter metrics should have "_total" suffix otelcol_receiver_refused_log_records counter metrics should have "_total" suffix otelcol_receiver_refused_spans counter metrics should have "_total" suffix

Steps to reproduce
Enable open telemetry own internal metrics to any level other than "none" via service::telemetry::metrics::level: and see the response of those internal metrics manually using curl as below
http://127.0.0.1:8888/metrics
Now, you can validate the response using promtool to validate the metrics naming rules

More details about promtool:
Prometheus (3PP) ships with a lightweight command-line utility called "Promtool" that helps to lint service metrics for consistency and correctness. Promtool validates metric names, labels, metadata, and types based on Prometheus instrumentation best practices (see https://prometheus.io/docs/practices/naming/ and https://prometheus.io/docs/practices/instrumentation/ for more details).

What did you expect to see?
All internal metrics of type "counter" should be suffixed with _total
otelcol_exporter_send_failed_log_records_total
otelcol_exporter_send_failed_spans_total
otelcol_exporter_sent_log_records_total
otelcol_exporter_sent_spans_total
otelcol_process_cpu_seconds_total
otelcol_process_runtime_total_alloc_bytes_total
otelcol_process_uptime_total
otelcol_processor_accepted_log_records_total
otelcol_processor_accepted_spans_total
otelcol_processor_batch_timeout_trigger_send_total
otelcol_processor_incoming_items_total
otelcol_processor_outgoing_items_total
otelcol_receiver_accepted_log_records_total
otelcol_receiver_accepted_spans_total
otelcol_receiver_refused_log_records_total
otelcol_receiver_refused_spans_total

What did you see instead?
otelcol_exporter_send_failed_log_records counter metrics should have "_total" suffix
otelcol_exporter_send_failed_spans counter metrics should have "_total" suffix
otelcol_exporter_sent_log_records counter metrics should have "_total" suffix
otelcol_exporter_sent_spans counter metrics should have "_total" suffix
otelcol_process_cpu_seconds counter metrics should have "_total" suffix
otelcol_process_runtime_total_alloc_bytes counter metrics should have "_total" suffix
otelcol_process_uptime counter metrics should have "_total" suffix
otelcol_processor_accepted_log_records counter metrics should have "_total" suffix
otelcol_processor_accepted_spans counter metrics should have "_total" suffix
otelcol_processor_batch_timeout_trigger_send counter metrics should have "_total" suffix
otelcol_processor_incoming_items counter metrics should have "_total" suffix
otelcol_processor_outgoing_items counter metrics should have "_total" suffix
otelcol_receiver_accepted_log_records counter metrics should have "_total" suffix
otelcol_receiver_accepted_spans counter metrics should have "_total" suffix
otelcol_receiver_refused_log_records counter metrics should have "_total" suffix
otelcol_receiver_refused_spans counter metrics should have "_total" suffix`

Collector version

0.126.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

Log output

`cat metrics.txt | ./promtool check metrics --extended
otelcol_exporter_send_failed_log_records counter metrics should have "_total" suffix
otelcol_exporter_send_failed_spans counter metrics should have "_total" suffix
otelcol_exporter_sent_log_records counter metrics should have "_total" suffix
otelcol_exporter_sent_spans counter metrics should have "_total" suffix
otelcol_process_cpu_seconds counter metrics should have "_total" suffix
otelcol_process_runtime_total_alloc_bytes counter metrics should have "_total" suffix
otelcol_process_uptime counter metrics should have "_total" suffix
otelcol_processor_accepted_log_records counter metrics should have "_total" suffix
otelcol_processor_accepted_spans counter metrics should have "_total" suffix
otelcol_processor_batch_timeout_trigger_send counter metrics should have "_total" suffix
otelcol_processor_incoming_items counter metrics should have "_total" suffix
otelcol_processor_outgoing_items counter metrics should have "_total" suffix
otelcol_receiver_accepted_log_records counter metrics should have "_total" suffix
otelcol_receiver_accepted_spans counter metrics should have "_total" suffix
otelcol_receiver_refused_log_records counter metrics should have "_total" suffix
otelcol_receiver_refused_spans counter metrics should have "_total" suffix`

Additional context

No response

@thiruvikraman-subburaman thiruvikraman-subburaman added the bug Something isn't working label May 26, 2025
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@thiruvikraman-subburaman
Copy link
Author

/label @bogdandrutu @dmitryax , can you help to provide your view on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant