open-telemetry/opentelemetry-dotnet
Vedi su GitHub[bug] UseOtlpExporter is not respecting services.Configure<OtlpExporterOptions> but AddOtlpExporter does
Open
#6231 aperta il 4 apr 2025
bughelp wantedpkg:OpenTelemetry.Exporter.OpenTelemetryProtocol
Metriche repository
- Star
- (3725 star)
- Metriche merge PR
- (Metriche PR in attesa)
Descrizione
Package
OpenTelemetry.Exporter.OpenTelemetryProtocol
Package Version
| Package Name | Version |
|---|---|
| OpenTelemetry.Exporter.OpenTelemetryProtocol | 1.11.2 |
| OpenTelemetry | 1.11.2 |
Runtime Version
net8.0
Description
UseOtlpExporter() is not respecting services.Configure<OtlpExporterOptions> Endpoint
Steps to Reproduce
- Configure non-default
Endpointvia e.g., environment variableOpenTelemetry__OtlpExporter__Endpoint services.Configure<OtlpExporterOptions>(ctx.Configuration.GetSection("OpenTelemetry:OtlpExporter"));services.AddOpenTelemetry().UseOtlpExporter()
Expected Result
UseOtlpExporter is respecting services.Configure<OtlpExporterOptions> Endpoint
Actual Result
Connecting with default URL
Exception: {1}{http://localhost:4317/opentelemetry.proto.collector.metrics.v1.MetricsService/Export}{System.Net.Http.HttpRequestException: Connection refused (localhost:4317)
---> System.Net.Sockets.SocketException (111): Connection refused
...but when separately adding AddOtlpExporter then Endpoint setting is read correctly.
Additional Context
No response