-
Notifications
You must be signed in to change notification settings - Fork 811
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
Many logs from OtlpMetricExporter. Exporting telemetry shouldn't generate new telemetry unless there is an error. #5717
Comments
APIs to remove logging are in Microsoft.Extensions.Http 8.0 and greater: See dotnet/runtime#77312 (comment) You want to call cc @CarnaViire |
@JamesNK I'm still getting up to speed in this repo, so I'm adding some notes that may or may not be obvious to anyone finding The SDK doesn't specifically register (AFAIK) the named client using
Or The code you linked to doesn't seem like it would facilitate using |
You're right that it can't happen in that location. Configuration could be added to the app to disable logging, but logging OTLP HTTP requests at an info level doesn't seem desirable in the first place. And I think it's weird how HttpClientFactory is used:
Using it selectively like this creates confusion. |
Yes, the fact that gRPC doesn't use @cijothomas / @vishweshbankwar - Do you know why the gRPC client doesn't use the The Logging exporter doesn't currently use the factory due to a circular dependency, but I assume the intent is to fix that. I agree; it would be nice for that to be consistent across OTLP exporters. The HTTP request logging at One option in this library is to explicitly register a named client and configure the removal of all loggers. That might impact the ease of diagnosing transient problems with the export, though. It might also be possible to hack around with the configuration to filter them automatically, although that behaviour might also be surprising. The maintainers might need to weigh in with a view on the preferred behaviour. I'd be happy to investigate further if the decision is to change the current behaviour. Alternatively, we should consider documenting how these can be disabled in customer applications. |
I am currently working on #5731 to remove dependency on Grpc.Net.Client entirely and use HttpClient for gRPC calls as well. With that, users would be able to control the HttpClient similar to OTLP/HTTP. I am looking to gather some initial feedback on it. |
As a result: at the moment is this some kind of effective and relatively "correct" way to disable or change the log level of opentelemetry? |
Any progress on this? |
The latest version of the OTLP exporter for .NET no longer depends on |
Can you elaborate on which version should be used and how to control the logging. I am currently seeing System.Net.Http 9.0.0 in my assemblies list |
Came here to complain that OTEL generates more telemetry about itself than my app does. I see I'm in the same boat as others :) |
I think that's the important thing here: Exporting telemetry shouldn't generate new telemetry unless there is an error. |
Solving your problems
|
Extra configuration shouldn't be required for this to be usable. |
As an aside, I couldn't find any easy way to shut [OTEL dotnet's use of] polly up either. |
https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/trace/extending-the-sdk#exporter Should be modified with any guidance for exporter author (including exporters maintained in this repo). It currently has "Exporters should avoid generating telemetry and causing live-loop, this can be done via OpenTelemetry.SuppressInstrumentationScope." and from what I can tell, is already followed by OTLP Exporters. If we need to modify it to talk about suppressing ILogger separately, so that Non-OTEL providers will also not get the logs, that should be added to the above doc. @JamesNK can you share if that is what you intended to convey? i.e OTLPExporters should itself shutoff My expectation is it should be up to end-users to turn it off, but I haven't thought fully through the implications.. |
Package
OpenTelemetry.Exporter.OpenTelemetryProtocol
Package Version
Runtime Version
net8.0
Description
I have configured OtlpMetricExporter to frequently export logs/metrics/traces. The console output of my app is overwhelmed by messages about sending logs:
The problem is the metrics (and tracing) exporters are configured to create the HttpClient from Microsoft.Extensions.Http, and it adds logging that outputs these messages. Every export writes 4 messages (8 lines) to console logs.
HttpClient logging should be disabled for these clients.
Steps to Reproduce
Configure OTLP export using OTLP/gRPC. Set export interval to a low number.
Expected Result
Clean console output.
Actual Result
Unhelpful log messages everywhere.
Additional Context
No response
The text was updated successfully, but these errors were encountered: