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
Describe your environment
Using requests or urllib3 instrumentation.
Steps to reproduce
Use an Logs exporter that makes a network call with requests or urllib3. Instrument requests or urllib3. Produce logs telemetry. Check to see that the log export call is incorrectly tracked as part of the requests or urllib3 instrumentation's traces. For instance, using the Azure exporter:
from logging import getLogger
from azure.monitor.opentelemetry.exporter import (
ApplicationInsightsSampler,
AzureMonitorLogExporter,
AzureMonitorTraceExporter,
)
from opentelemetry import trace
from opentelemetry._logs import get_logger_provider, set_logger_provider
from opentelemetry.instrumentation.requests import RequestsInstrumentor
from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler
from opentelemetry.sdk._logs.export import BatchLogRecordProcessor
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor
from opentelemetry.trace import get_tracer_provider, set_tracer_provider
# Setup Tracing
tracer_provider = TracerProvider(
sampler=ApplicationInsightsSampler(),
)
set_tracer_provider(tracer_provider)
trace_exporter = AzureMonitorTraceExporter()
span_processor = BatchSpanProcessor(
trace_exporter,
)
get_tracer_provider().add_span_processor(span_processor)
tracer = trace.get_tracer(__name__)
# Setup Logging
logger_provider = LoggerProvider()
set_logger_provider(logger_provider)
log_exporter = AzureMonitorLogExporter()
log_record_processor = BatchLogRecordProcessor(
log_exporter,
)
get_logger_provider().add_log_record_processor(log_record_processor)
handler = LoggingHandler(logger_provider=get_logger_provider())
getLogger().addHandler(handler)
RequestsInstrumentor().instrument()
# Produce logging telemetry
getLogger(__name__).error("Test Error")
What is the expected behavior?
Export calls should be suppressed.
What is the actual behavior?
Export call is not suppressed.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe your environment
Using requests or urllib3 instrumentation.
Steps to reproduce
Use an Logs exporter that makes a network call with requests or urllib3. Instrument requests or urllib3. Produce logs telemetry. Check to see that the log export call is incorrectly tracked as part of the requests or urllib3 instrumentation's traces. For instance, using the Azure exporter:
What is the expected behavior?
Export calls should be suppressed.
What is the actual behavior?
Export call is not suppressed.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: