Does OpenTelemetry support a custom Http handler (DelegatingHandler) for logs/metrics/traces? #7183
|
We're implementing OpenTelemetry in our Azure-hosted .NET apps. We currently use app insights for log analytics, but the plan is to send OTel logs to a collector that will then be ingested by SumoLogic. By examining our logs in Azure app insights, we've discovered that around 10% of our metrics calls to the collector are failing. In an attempt to gather more information, we used AI tools to implement a Here is our setup for the And here is the handler itself: Again, this code was AI-generated. From my understanding, this will only work if the OpenTelemetry libraries are using named |
Replies: 1 comment
|
You can either assign a delegate to a method to create Or there's an HttpClientFactory integration (code). |
You can either assign a delegate to a method to create
HttpClientinstances yourself:opentelemetry-dotnet/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Lines 155 to 165 in 8bee1f4
Or there's an HttpClientFactory integration (code).