Closed vinishiru closed 2 months ago
Expected Result Metric names should contains unit appended to their names.
That is, not something OTel spec supports today. It is a feature of OpenTelemetry Prometheus exporter only, and not when using any other exporter, like OTLP. If you are using Collector, then I expect collector would do the appending on name with unit when exposing to Prometheus. Or if you are using native OTLP Ingestion in Prometheus, then prometheus itself could be doing that.
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md shows the OTEL and Prometheus compatibility. It is still experimental, and so is the PrometheusExporter shipped from this repo.
Package
OpenTelemetry.Exporter.OpenTelemetryProtocol
Package Version
Runtime Version
net8.0
Description
Our application uses metrics exposed by the
AddAspNetCoreInstrumentation
. Before updating to the OpenTelemetry Exporter, we were using theAddPrometheusExporter
+MapPrometheusScrapingEndpoint
, so Prometheus could scrape the application directly.After changing to the OpenTelemetry Exporter (
AddOtlpExporter
), we noticed that metric names have changed. The unit is not been appended on metric name as before, impacting the dashboards provided by .NET Team for Grafana ASP.NET Core Dashboard (You can check that the dashboard template is configured with metrics that contains the unit suffix)Example of metric name with Prometheus Exporter: http_server_request_duration_seconds
Metric name with OtlpExporter: http_server_request_duration
Steps to Reproduce
WithMetrics
extension and add bothAddOtlpExporter
and point it to the Opel Collector (default: http://localhost:4317).Expected Result
Metric names should contains unit appended to their names. Ex:
Actual Result
Metrics with no unit appended, for example:
Additional Context
Perhas is just a configuration issue on my part, but I could not find any configuration that makes the OpenTelemetry exporter to append the metric unit.