opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

OpenTelemetry logs not being suppressed on the console.

Open abhinavyesss opened this issue 1 year ago • 3 comments

Python 3.10.12 opentelemetry-api 1.24.0 opentelemetry-instrumentation-flask 0.45b0 azure-monitor-opentelemetry 1.4.1

My code is similar to the one displayed in this example. I have initialized OTEL_LOGS_EXPORTER=None.

On setting the above variable as None, I expected logs to not be exported.

However my console is filled with logs like: [2024-05-03 12:36:59,299][INFO][Process-483][OtelPeriodicExportingMetricReader][_universal][on_response] Response status: 200 Response headers: 'Transfer-Encoding': 'chunked' 'Content-Type': 'application/json; charset=utf-8' 'Server': 'Microsoft-HTTPAPI/2.0' 'Strict-Transport-Security': 'REDACTED' 'X-Content-Type-Options': 'REDACTED' 'Date': 'Fri, 03 May 2024 12:36:57 GMT' [2024-05-03 12:36:59,704][INFO][Process-488][OtelPeriodicExportingMetricReader][_universal][on_response] Response status: 200 Response headers: 'Transfer-Encoding': 'chunked' 'Content-Type': 'application/json; charset=utf-8' 'Server': 'Microsoft-HTTPAPI/2.0' 'Strict-Transport-Security': 'REDACTED' 'X-Content-Type-Options': 'REDACTED' 'Date': 'Fri, 03 May 2024 12:36:57 GMT'

This makes it hard for me to view the actual logs. What would be the correct way to stop these message from being displayed on the console?

abhinavyesss avatar May 03 '24 12:05 abhinavyesss

Hi @abhinavyesss, can i take a look if this is still open

arunk1988 avatar May 29 '24 12:05 arunk1988

@arunk1988 Yeah sure go ahead. I just muted those particular functions from logging.

abhinavyesss avatar May 29 '24 13:05 abhinavyesss

@abhinavyesss

I'm not able to reproduce the issue in my local environment. Do you happen to be running this in a container or an azure app service instance/azure functions instance?

A full snippet of your code and how you instrument would be useful as well.

Also in the future please raise your issues related to Azure monitor here: https://github.com/Azure/azure-sdk-for-python/issues

lzchen avatar Jul 02 '24 18:07 lzchen

Closing due to inactivity

lzchen avatar Oct 31 '24 17:10 lzchen