-
Notifications
You must be signed in to change notification settings - Fork 287
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
Microsoft.Extensions.Logging.ApplicationInsights adds trace IDs a 2nd time to trace telemetry #2862
Comments
have you enabled scopes feature? it is likely that traceid and other duplicate info is coming from scopes. |
Yes, I have scopes enabled because I want my log scopes added to the telemetry. |
Thanks for confirming! Are you enabling it yourself using this doc? Or it is coming automatically? Not much we can do about it in this repo now. I have seen similar issues reported in OpenTelemetry as well. There are some PRs in asp.net core where it is removing these things from scopes, so it won't end up being duplicated. |
@cijothomas I'm using the default options, which includes the activity tracing info in logger scope. I was hesitant to remove them via the startup options because maybe they're helpful for looking through the console logs if my telemetry isn't working. But that seems like a weak reason, so I think I will just disable those.
Why is that? I figured the telemetry processor that adds the logger scopes to the telemetry could filter out the telemetry properties because those are clearly duplicate information. Or is that handled by something lower level in asp.net core? |
I meant to say this repo won't offer a new feature to selectively disable certain scope fields. It is mainly because of OpenTelemetry quickly becoming the instrumentation choice, and not much feature additions are occurring in this repo. Probably possible to remove the duplicates yourself with a custom telemetry processor, if you can identify then reliably. (in your case, it looks like it should be possible, as you are looking to remove certain fields like traceid,spanid) |
*.csproj
file): netstandard2.0Describe the bug
The trace IDs (span, parent, trace) are included in all telemetry by default, but they’re also included in all log messages. So when we send log messages to app insights as traces, they’re on the trace telemetry twice. Both as custom properties, and system properties.
They're also on Exception telemetry emitted by the same library.
To Reproduce
Use the Microsoft.Extensions.Logging.ApplicationInsights package and log a warning and an exception.
The text was updated successfully, but these errors were encountered: