-
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
accept standard OpenTelemetry environmental variables for configuration #12
Comments
Just a pointer on this one: ideally, it should be supported via Extensions.Configuration using The initial implementation of the OTEL libraries were only considering actual env vars and not using the configuration system to read them and that was a mistake (it has since been changed). |
@nblumhardt Is there another sink that uses the |
Splitting Trying to meld the two (explicit parameters for endpoints etc. + default ones from configuration) seems fraught with difficulties, so better if the user decides which style they're after. IIRC the Serilog.Sinks.MSSqlServer sink does some special options support along these lines (not sure if it's the model to follow, but might help). HTH! |
Thanks! Will take a look. |
Just adding another note for when we're back around to this; the typical way for Serilog to interact with external configuration is via Given that the OTel variables are already defined and won't conform to any schema Serilog currently recognizes, we might be best off adding a There's no restriction preventing e.g. an Edit: clarifying - this would be called instead of |
The opentelemetry-dotnet project's OtlpExporterOptions class might be a helpful example of merging these environment variables with dotnet's Options pattern. |
This method configure with default environmental variables definitions Fixes serilog#12
@nblumhardt I've created a PR #141 Can you review please? |
@AlbertoMonteiro I found another environment variables which seems to be missing in the PR: OTEL_SERVICE_NAME https://opentelemetry.io/docs/languages/sdk-configuration/general/#otel_service_name Could you add support for this aswell? |
@prochnowc |
@nblumhardt Many thanks. It's really helpfull when using Aspire. |
See the OpenTelemetry environmental variable definitions.
The text was updated successfully, but these errors were encountered: