Skip to content
Draft
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
7 changes: 7 additions & 0 deletions solarwinds_apm/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
import logging

from opentelemetry import context, trace
from opentelemetry.instrumentation._labeler import get_labeler
from opentelemetry.trace import NoOpTracerProvider, get_tracer_provider

from solarwinds_apm.apm_constants import (
INTL_SWO_OTEL_CONTEXT_ENTRY_SPAN,
INTL_SWO_TRANSACTION_ATTR_KEY,
INTL_SWO_TRANSACTION_NAME_ATTR,
)
from solarwinds_apm.oboe import get_transaction_name_pool
Expand Down Expand Up @@ -93,6 +95,11 @@ def set_transaction_name(custom_name: str) -> bool:
current_trace_entry_span.set_attribute(
INTL_SWO_TRANSACTION_NAME_ATTR, registered_name
)

# Also sets transaction name in Labeler used by some upstream instrumentors
labeler = get_labeler()
labeler.add(INTL_SWO_TRANSACTION_ATTR_KEY, registered_name)

return True


Expand Down
Loading