-
Notifications
You must be signed in to change notification settings - Fork 780
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 #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? |
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: