-
Notifications
You must be signed in to change notification settings - Fork 18
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
HttpMessageHandler cannot be configured when initialization Serilog.Sinks.OpenTelemetry via configuration #127
Comments
I see also the usage of HttpClient in combination with the usage of HttpMessageHandler problematic: Line 53 in 8aba132
Better would be to use the IHttpClientFactory or inject the HttpClient via constructor. (see Guidelines for using HttpClient) Anyway I think serilog-sinks-opentelemetry has two issues which might be worth to fix:
In my opinion we are in the ecosystem of dotnet core and should use the concepts which are existing. |
Thanks for all the notes. This seems like something to consider from the Needs a design sketch to get the ball rolling, I think 👍 |
Serilog sinks aren't necessarily instantiated through dependency injection, so the Even the The In my opinion, the current implementation follows best practice for modern dotnet. @nblumhardt I think that an easier approach would be to support mixed configuration (file and code) in
I think an ideal scenario would be to have something like this: loggerConfiguration
.ReadFrom.Configuration(...)
.ThenFrom.Options<SinkOptions>((opts) => ...)
... Or just chained |
Dear community.
I'm initialization the
Serilog.Sinks.OpenTelemetry
only via the configuration file and getting an error because the HTTP connection cannot be estabshiled. The reason why is quite simple because my application uses the default proxy. I have taken a look into the code and saw that it is not possible to inject the HttpMessageHandler via the options BatchedOpenTelemetrySinkOptions to disable the proxy.Here is my serilog configuration in appsetttings.json:
And my host builder setup:
I'm using the
Serilog.Sinks.OpenTelemetry
nuget package version 1.2.0 in a dot core 6.0 console application on windows10.Regards
Hardy
The text was updated successfully, but these errors were encountered: