Closed mbmcmullen27 closed 2 years ago
Have you done using OpenTelemetry.Metrics
?
We have working examples in the repo https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/examples/AspNetCore You may check that.
Haha wow, yup it builds after adding that. I knew it had to be something silly. Thanks so much :+1:
Bug Report
OpenTelemetry Package versions: OpenTelemetry.Api 1.3.0-beta.2 OpenTelemetry.Extensions.Hosting 1.0.0-rc9.3 OpenTelemetry.Instrumentation.AspNetCore 1.0.0-rc9 OpenTelemetry.Exporter.Console 1.3.0-beta.2 OpenTelemetry.Exporter.OpenTelemetryProtocol 1.3.0-beta.2 OpenTelemetry.Exporter.Prometheus 1.3.0-beta.2 OpenTelemetry.Instrumentation.Http 1.0.0-rc9
Runtime version : netcoreapp3.1
Symptom
I'm building a PoC of a simple webapi with OpenTelemetry Tracing using the
dotnet new webapi
template for dotnet 3.1 I was able to instrument the app with traces, without issue, and I can send them to Tempo and view them as expected.However, when I attempt to add OpenTelemetry metrics and the Prometheus Exporter, following the instructions here I get unexpected errors. Specifically:
According to the instructions and nuget this version of the Prometheus Exporter package should be compatible with dotnet core 3.1.
I would expect this to build so I could verify the behavior.
Reproduce
project repo: https://github.com/mbmcmullen27/dotnet-opentel-poc
dotnet build
alternatively if docker is available
docker build . -t opentelemetry-poc
both methods reproduce the same error
Additional Context
OpenTelemetry documentation website only has instructions for dotnet 6, is dotnet 3.1 still supported, did the method get moved, or am I missing something obvious here? Any advice on how to get this working is greatly appreciated.
Thanks