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

BLRP Export unsupressed. #3376

Closed
jeremydvoss opened this issue Jul 11, 2023 · 0 comments · Fixed by #3375
Closed

BLRP Export unsupressed. #3376

jeremydvoss opened this issue Jul 11, 2023 · 0 comments · Fixed by #3375
Labels
bug Something isn't working

Comments

@jeremydvoss
Copy link
Contributor

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.

@jeremydvoss jeremydvoss added the bug Something isn't working label Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant