Prometheus metric names incorrectly append unit #4742
Labels
bug
Something isn't working
pkg:OpenTelemetry.Exporter.Prometheus.AspNetCore
Issues related to OpenTelemetry.Exporter.Prometheus.AspNetCore NuGet package
Bug Report
List of all OpenTelemetry NuGet
packages and version that you are
using (e.g.
OpenTelemetry 1.0.2
):Runtime version (e.g.
net462
,net48
,netcoreapp3.1
,net6.0
etc. You canfind this information from the
*.csproj
file):Symptom
The .NET prometheus exporter doesn't correctly follow the specification for outputting units:
https://github.com/open-telemetry/opentelemetry-specification/blob/065b25024549120800da7cda6ccd9717658ff0df/specification/compatibility/prometheus_and_openmetrics.md?plain=1#L235-L240
For example, a unit in brackets is included in the output. Brackets should be removed.
.NET code:
Output:
This counter shouldn't have a unit because
{TestUnitWithBrackets}
is surrounded by brackets.What is the expected behavior?
No unit on the counter.
What is the actual behavior?
The counter has a unit of
TestUnitWithBrackets
Reproduce
We will close this issue if:
projects, so don't point us to such, please.
Additional Context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: