-
Notifications
You must be signed in to change notification settings - Fork 293
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
Prometheus fails to scrap Process/Runtime Instrumentation metrics due to issues with units #1617
Comments
You can configure the Prometheus exporter to disable the The PR is here open-telemetry/opentelemetry-dotnet#5305 and is included in releases starting with 1.8.0-beta.1: https://github.com/open-telemetry/opentelemetry-dotnet/blob/dbec6f845a4295f908c85909602283802514b1b2/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md?plain=1#L19 The units would look like this:
|
Thanks - I will take a look at the latest release this week! |
This does not fix Using following dependencies: <PackageVersion Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.8.0-rc.1" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.8.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.8.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.8.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.8.0" />
|
I couldn't reproduce your issue. Can you create a minimal reproduce app? I can get the expected metric:
with this code snippet:
using following dependencies:
|
@xiang17 I'm sorry, but it seems to have been a fluke I can't reproduce any more. Feel free to ignore my comment. |
I'm seeing this issue too in the .NET Aspire samples repo after updating to To workaround fully I had to downgrade to 1.8.0-beta.1 and disable the option highlighted above, i.e.: builder.Services.AddOpenTelemetry()
// BUG: Part of the workaround for https://github.com/open-telemetry/opentelemetry-dotnet-contrib/issues/1617
.WithMetrics(metrics => metrics.AddPrometheusExporter(options => options.DisableTotalNameSuffixForCounters = true)); |
but when I've upgraded from 1.7.0/1.7.1 to 1.8.1/1.8.0rc1 (detailed NuGet versions bellow) it added
old NuGets:
new NuGets:
|
@JanVargovsky please take a look at the above solution with |
I can confirm the |
@kharabasz, do you need more help here or we can close the issue? |
@Kielek It can be closed - thank you |
Issue with OpenTelemetry.Instrumentation.Process & OpenTelemetry.Instrumentation.Runtime
List of all OpenTelemetry NuGet
packages and version that you are
using (e.g.
OpenTelemetry 1.3.2
):Runtime version (e.g.
net462
,net48
,net6.0
,net7.0
etc. You canfind this information from the
*.csproj
file):Is this a feature request or a bug?
What is the expected behavior?
.AddProcessInstrumentation()
coupled with.AddPrometheusExported()
should correctly export metrics to Prometheus..AddRuntimeInstrumentation()
coupled with.AddPrometheusExported()
should correctly export metrics to Prometheus.What is the actual behavior?
We receive an exemplar error when Prometheus hits the scrape target:
Process and Runtime metrics exported in Prometheus format do not meet OpenMetrics specification. The unit used attached in metadata does not match the metric suffix in several cases, causing Prometheus server and OpenTelemetry Collector's Prometheus receiver to throw errors while scraping the target.
The units were defined in metadata for those metrics:
OpenMetrics specification regarding units: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#unit
Additional Context
OT configuration:
With appsettings.json containing:
The text was updated successfully, but these errors were encountered: