Skip to content
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

Disable self-logging and self-tracing in Azure Monitor distro, exporter, and livemetrics #43359

Merged
merged 4 commits into from
Apr 17, 2024

Conversation

lmolkova
Copy link
Member

@lmolkova lmolkova commented Apr 11, 2024

Fixes #43286

In fact it's already fixed with #41858, this change prevents traces/logs creation from happening from LiveMetrics, Exporter or Distro, i.e. serves as a small optimization.

It changes the default - disables diagnostics, but in theory users can still enable if it's ever necessary to diagnose AzMon issues.

@TimothyMothra
Copy link
Contributor

In fact it's already fixed with #41858,

Hmmm, that doesn't appear to be the case. I validated the open issue against the current main branch.

@lmolkova
Copy link
Member Author

In fact it's already fixed with #41858,

Hmmm, that doesn't appear to be the case. I validated the open issue against the current main branch.

Did you see them in console or in the AppInsights resource?
Based on the test I wrote, OTel logger blocks any logs under suppressed scope here
https://github.com/open-telemetry/opentelemetry-dotnet/blob/876e4faa5aac56f456b52e4fbca965ce0e7b9b13/src/OpenTelemetry/Logs/ILogger/OpenTelemetryLogger.cs#L113

and nothing goes to the backend. Console/other provides logs will appear though.

This change also blocks console/other providers from ever seeing exporter/live metrics logs/traces

@TimothyMothra
Copy link
Contributor

In fact it's already fixed with #41858,

Hmmm, that doesn't appear to be the case. I validated the open issue against the current main branch.

Did you see them in console or in the AppInsights resource? Based on the test I wrote, OTel logger blocks any logs under suppressed scope here https://github.com/open-telemetry/opentelemetry-dotnet/blob/876e4faa5aac56f456b52e4fbca965ce0e7b9b13/src/OpenTelemetry/Logs/ILogger/OpenTelemetryLogger.cs#L113

and nothing goes to the backend. Console/other provides logs will appear though.

This change also blocks console/other providers from ever seeing exporter/live metrics logs/traces

Ah, I was only testing the local console as this was the user's first complaint.

@TimothyMothra
Copy link
Contributor

(not for this pr)
Do you think it's worth introducing a flag to allow users to opt-out of the LogForwarder?
I'm concerned about the volume of logs that may be collected.
I understand that a user can opt-out of the individual log sources.
But what can we offer a user that gets tired of playing whack-a-mole with their logs? :)

@lmolkova
Copy link
Member Author

lmolkova commented Apr 11, 2024

Do you think it's worth introducing a flag to allow users to opt-out of the LogForwarder?
I'm concerned about the volume of logs that may be collected.
I understand that a user can opt-out of the individual log sources.
But what can we offer a user that gets tired of playing whack-a-mole with their logs? :)

I'm totally open to add it in this or other PR, but users can easily disable all Azure logs by doing

  "Logging" : {
    "LogLevel" : {"Azure" : "None"}
  }

and extra API flag would just do the same, but introduce some conflicts (e.g. appsetting.json says it's enabled and flag disables it - it'd be harder to debug)

@TimothyMothra
Copy link
Contributor

TimothyMothra commented Apr 11, 2024

I'm totally open to add it in this or other PR, but users can easily disable all Azure logs by doing

Thanks. I think we can skip for now and continue to monitor user feedback.

For now, I think we should include a mention in the Distro Readme describing where these extra logs are coming from and how to opt-out. I can make an attempt at this.

Copy link
Contributor

@rajkumar-rangaraj rajkumar-rangaraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cijothomas
Copy link
Contributor

I'm totally open to add it in this or other PR, but users can easily disable all Azure logs by doing

Thanks. I think we can skip for now and continue to monitor user feedback.

For now, I think we should include a mention in the Distro Readme describing where these extra logs are coming from and how to opt-out. I can make an attempt at this.

Agree!
If ILogger's filtering can be used to control this already, then its best not to introduce another setting in distro.

@lmolkova lmolkova force-pushed the distro-disable-self-logging-tracing branch from bd537c2 to 4cc2cd1 Compare April 12, 2024 17:12
@lmolkova lmolkova merged commit f40ee39 into Azure:main Apr 17, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Monitor - Distro Monitor OpenTelemetry Distro Monitor - Exporter Monitor OpenTelemetry Exporter Monitor - LiveMetrics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] UseAzureMonitor collects too many internal logs
4 participants