Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/instana/instrumentation/aioamqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ async def basic_publish_with_instana(
argv: Tuple[object, Tuple[object, ...]],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
if not tracer:
return await wrapped(*argv, **kwargs)

Expand Down Expand Up @@ -58,7 +58,7 @@ async def basic_consume_with_instana(
argv: Tuple[object, Tuple[object, ...]],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
if not tracer:
return await wrapped(*argv, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/aiohttp/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def stan_request_start(
session: "ClientSession", trace_config_ctx: SimpleNamespace, params
) -> Awaitable[None]:
try:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# If we're not tracing, just return
if not tracer:
trace_config_ctx.span_context = None
Expand Down
4 changes: 1 addition & 3 deletions src/instana/instrumentation/aws/boto3.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

from instana.log import logger
from instana.propagators.format import Format
from instana.singletons import get_tracer
from instana.util.traceutils import extract_custom_headers, get_tracer_tuple

def lambda_inject_context(
Expand All @@ -37,7 +36,6 @@ def lambda_inject_context(
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/lambda.html#Lambda.Client.invoke
"""
try:
tracer = get_tracer()
invoke_payload = payload.get("Payload", {})

if not isinstance(invoke_payload, dict):
Expand Down Expand Up @@ -67,7 +65,7 @@ def make_api_call_with_instana(
args: Sequence[Dict[str, Any]],
kwargs: Dict[str, Any],
) -> Dict[str, Any]:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# If we're not tracing, just return
if not tracer:
return wrapped(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/aws/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def collect_s3_injected_attributes(
args: Sequence[object],
kwargs: Dict[str, Any],
) -> Callable[..., object]:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# If we're not tracing, just return
if not tracer:
return wrapped(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def cb_request_error(
def request_init_with_instana(
fn: "ResponseFuture",
) -> None:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
if not tracer:
return

Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def before_task_publish(
**kwargs: Dict[str, Any],
) -> None:
try:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
if not tracer:
return

Expand Down
4 changes: 2 additions & 2 deletions src/instana/instrumentation/couchbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def wrapper(
args: Tuple[object, ...],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# If we're not tracing, just return
if not tracer:
return wrapped(*args, **kwargs)
Expand All @@ -120,7 +120,7 @@ def query_with_instana(
args: Tuple[object, ...],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# If we're not tracing, just return
if not tracer:
return wrapped(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/google/cloud/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def publish_with_instana(
"""References:
- PublisherClient.publish(topic_path, messages, metadata)
"""
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# return early if we're not tracing
if not tracer:
return wrapped(*args, **kwargs)
Expand Down
8 changes: 4 additions & 4 deletions src/instana/instrumentation/google/cloud/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def execute_with_instana(
args: Tuple[object, ...],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()

# batch requests are traced with finish_batch_with_instana()
# also return early if we're not tracing
Expand Down Expand Up @@ -94,7 +94,7 @@ def download_with_instana(
args: Tuple[object, ...],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# return early if we're not tracing
if not tracer:
return wrapped(*args, **kwargs)
Expand Down Expand Up @@ -130,7 +130,7 @@ def upload_with_instana(
args: Tuple[object, ...],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# return early if we're not tracing
if not tracer:
return wrapped(*args, **kwargs)
Expand All @@ -155,7 +155,7 @@ def finish_batch_with_instana(
args: Tuple[object, ...],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# return early if we're not tracing
if not tracer:
return wrapped(*args, **kwargs)
Expand Down
4 changes: 2 additions & 2 deletions src/instana/instrumentation/httpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def handle_request_with_instana(
args: Tuple[int, str, Tuple[Any, ...]],
kwargs: Dict[str, Any],
) -> httpx.Response:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# If we're not tracing, just return
if not tracer:
return wrapped(*args, **kwargs)
Expand Down Expand Up @@ -99,7 +99,7 @@ async def handle_async_request_with_instana(
args: Tuple[int, str, Tuple[Any, ...]],
kwargs: Dict[str, Any],
) -> httpx.Response:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# If we're not tracing, just return
if not tracer:
return await wrapped(*args, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def trace_kafka_produce(
args: Tuple[int, str, Tuple[Any, ...]],
kwargs: Dict[str, Any],
) -> None:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
if not tracer:
return wrapped(*args, **kwargs)

Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/kafka/kafka_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def trace_kafka_send(
args: Tuple[int, str, Tuple[Any, ...]],
kwargs: Dict[str, Any],
) -> "FutureRecordMetadata":
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()

if not tracer:
return wrapped(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def log_with_instana(
stacklevel = stacklevel_in + 1

try:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# Only needed if we're tracing and serious log and logging spans are not disabled
if (
not tracer
Expand Down
6 changes: 3 additions & 3 deletions src/instana/instrumentation/pep0249.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def execute(
sql: str,
params: Optional[Dict[str, Any]] = None,
) -> Callable[[str, Dict[str, Any]], None]:
tracer, parent_span, operation_name = get_tracer_tuple()
tracer, _, operation_name = get_tracer_tuple()

# If not tracing or we're being called from sqlalchemy, just pass through
if not tracer or (operation_name == "sqlalchemy"):
Expand All @@ -92,7 +92,7 @@ def executemany(
sql: str,
seq_of_parameters: List[Dict[str, Any]],
) -> Callable[[str, List[Dict[str, Any]]], None]:
tracer, parent_span, operation_name = get_tracer_tuple()
tracer, _, operation_name = get_tracer_tuple()

# If not tracing or we're being called from sqlalchemy, just pass through
if not tracer or (operation_name == "sqlalchemy"):
Expand All @@ -117,7 +117,7 @@ def callproc(
proc_name: str,
params: Dict[str, Any],
) -> Callable[[str, Dict[str, Any]], None]:
tracer, parent_span, operation_name = get_tracer_tuple()
tracer, _, operation_name = get_tracer_tuple()

# If not tracing or we're being called from sqlalchemy, just pass through
if not tracer or (operation_name == "sqlalchemy"):
Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/pika.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def _bind_args(
) -> Tuple[object, ...]:
return (exchange, routing_key, body, properties, args, kwargs)

tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()

# If we're not tracing, just return
if not tracer:
Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/pymongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self) -> None:
self.__active_commands = {}

def started(self, event: pymongo.monitoring.CommandStartedEvent) -> None:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()
# return early if we're not tracing
if not tracer:
return
Expand Down
4 changes: 2 additions & 2 deletions src/instana/instrumentation/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def execute_command_with_instana(
args: Tuple[object, ...],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, operation_name = get_tracer_tuple()
tracer, _, operation_name = get_tracer_tuple()

# If we're not tracing, just return
if not tracer or (operation_name in EXCLUDED_PARENT_SPANS):
Expand All @@ -71,7 +71,7 @@ def execute_with_instana(
args: Tuple[object, ...],
kwargs: Dict[str, Any],
) -> object:
tracer, parent_span, operation_name = get_tracer_tuple()
tracer, _, operation_name = get_tracer_tuple()

# If we're not tracing, just return
if not tracer or (operation_name in EXCLUDED_PARENT_SPANS):
Expand Down
2 changes: 1 addition & 1 deletion src/instana/instrumentation/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def receive_before_cursor_execute(
**kw: Dict[str, Any],
) -> None:
try:
tracer, parent_span, _ = get_tracer_tuple()
tracer, _, _ = get_tracer_tuple()

# If we're not tracing, just return
if not tracer:
Expand Down
2 changes: 0 additions & 2 deletions src/instana/instrumentation/tornado/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,3 @@ def finish_tracing(future: "Future", span: "InstanaSpan") -> None:
logger.debug("Instrumenting tornado client")
except ImportError:
pass
except ImportError:
pass
2 changes: 1 addition & 1 deletion src/instana/instrumentation/urllib3.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def urlopen_with_instana(
args: Tuple[int, str, Tuple[Any, ...]],
kwargs: Dict[str, Any],
) -> urllib3.response.HTTPResponse:
tracer, parent_span, span_name = get_tracer_tuple()
tracer, _, span_name = get_tracer_tuple()

# If we're not tracing, just return; boto3 has it's own visibility
if not tracer or span_name == "boto3":
Expand Down
Loading