Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/instana/instrumentation/urllib3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
from instana.propagators.format import Format
from instana.singletons import agent
from instana.util.secrets import strip_secrets_from_query
from instana.util.traceutils import get_tracer_tuple, tracing_is_off, extract_custom_headers
from instana.util.traceutils import (
get_tracer_tuple,
tracing_is_off,
extract_custom_headers,
)

if TYPE_CHECKING:
from instana.span.span import InstanaSpan
Expand Down Expand Up @@ -91,7 +95,11 @@ def urlopen_with_instana(
tracer, parent_span, span_name = get_tracer_tuple()

# If we're not tracing, just return; boto3 has it's own visibility
if tracing_is_off() or (span_name == "boto3"):
if (
tracing_is_off()
or (span_name == "boto3")
or (agent.options.allow_exit_as_root and "com.instana" in kwargs.get("url"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

That works, but it will block all spans pointing to any URL containing "com.instana", and this can cause missing spans in the future.

Why not revisit the PR #562 and supress all internal calls?

):
return wrapped(*args, **kwargs)

parent_context = parent_span.get_span_context() if parent_span else None
Expand Down
Loading