serilog-sinks-opentelemetry
serilog-sinks-opentelemetry copied to clipboard
Allow configuring OTEL_* settings from anywhere, not only environment
#141 (see also #12) has brought support for standard OpenTelemetry configuration (OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
and so on), but it only consumes them from environment, while standard OpenTelemetry implementation in .NET allow consuming the same configuration options from passed IConfiguration
, no matter where they are defined (which is handy for non-standard deployments). I propose we add some way to pass any configuration to the OpenTelemetry
configuration method.
As I understand that adding IConfiguration
would not be desirable due to an additional dependency, I propose we simply expose already existing Func<string, string?>
configuration getter (which is very easily mappable to IConfiguration.Item[string]
, to allow for additional extensibility.