You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Runtime version (e.g. net462, net48, netcoreapp3.1, net6.0 etc. You can
find this information from the *.csproj file):
net48/net6.0/net7.0
Symptom
When providing the OTEL_EXPORTER_OTLP_ENDPOINT value through a source other than environment variables, the setting is completely ignored for the logging configuration, but is honored for the tracing and metrics ones.
What is the expected behavior?
I'd expect for all the standard configuration keys to be honored in all 3 telemetry flows in the same way so that I can centralize and simplify my configuration.
What is the actual behavior?
Logs are not pushed to my collector address, since it keeps targeting the standard localhost endpoint.
Bug Report
List of all OpenTelemetry NuGet
packages and version that you are
using (e.g.
OpenTelemetry 1.0.2
):Runtime version (e.g.
net462
,net48
,netcoreapp3.1
,net6.0
etc. You canfind this information from the
*.csproj
file):Symptom
When providing the
OTEL_EXPORTER_OTLP_ENDPOINT
value through a source other than environment variables, the setting is completely ignored for the logging configuration, but is honored for the tracing and metrics ones.What is the expected behavior?
I'd expect for all the standard configuration keys to be honored in all 3 telemetry flows in the same way so that I can centralize and simplify my configuration.
What is the actual behavior?
Logs are not pushed to my collector address, since it keeps targeting the standard localhost endpoint.
Reproduce
https://github.com/julealgon/OTELLoggingIgnoresConfigurationSample
Sample contains 2 launch profiles:
OTEL_EXPORTER_OTLP_ENDPOINT
viaappsettings.json
OTEL_EXPORTER_OTLP_ENDPOINT
via an environment variableIt produces a small log when run.
For the AppSettings scenario:
For the EnvVars scenario:
Additional Context
This happens because of the way the options instance is initialized inside the
AddOtlpExporter
extension:opentelemetry-dotnet/src/OpenTelemetry.Exporter.OpenTelemetryProtocol.Logs/OtlpLogExporterHelperExtensions.cs
Line 58 in 690f7e5
opentelemetry-dotnet/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpExporterOptions.cs
Lines 60 to 61 in 690f7e5
This is related to:
The text was updated successfully, but these errors were encountered: