diff --git a/rasa_sdk/tracing/config.py b/rasa_sdk/tracing/config.py index 2f7e304b5..fc022a45f 100644 --- a/rasa_sdk/tracing/config.py +++ b/rasa_sdk/tracing/config.py @@ -14,7 +14,7 @@ from rasa_sdk.tracing.endpoints import EndpointConfig, read_endpoint_config -TRACING_SERVICE_NAME = os.environ.get("TRACING_SERVICE_NAME", "rasa_sdk") +TRACING_SERVICE_NAME = os.environ.get("RASA_SDK_TRACING_SERVICE_NAME", "rasa_sdk") ENDPOINTS_TRACING_KEY = "tracing" @@ -90,9 +90,7 @@ def configure_from_endpoint_config(cls, cfg: EndpointConfig) -> TracerProvider: :return: The configured `TracerProvider`. """ provider = TracerProvider( - resource=Resource.create( - {SERVICE_NAME: cfg.kwargs.get("service_name", TRACING_SERVICE_NAME)} - ) + resource=Resource.create({SERVICE_NAME: TRACING_SERVICE_NAME}) ) jaeger_exporter = JaegerExporter( @@ -132,9 +130,7 @@ def configure_from_endpoint_config(cls, cfg: EndpointConfig) -> TracerProvider: :return: The configured `TracerProvider`. """ provider = TracerProvider( - resource=Resource.create( - {SERVICE_NAME: cfg.kwargs.get("service_name", TRACING_SERVICE_NAME)} - ) + resource=Resource.create({SERVICE_NAME: TRACING_SERVICE_NAME}) ) insecure = cfg.kwargs.get("insecure") diff --git a/rasa_sdk/tracing/utils.py b/rasa_sdk/tracing/utils.py index cb5d22450..d3fbc648c 100644 --- a/rasa_sdk/tracing/utils.py +++ b/rasa_sdk/tracing/utils.py @@ -27,7 +27,7 @@ def get_tracer_and_context( tracer_provider: Optional[TracerProvider], request: Request ) -> Tuple[Any, Any, Text]: """Gets tracer and context""" - span_name = "rasa_sdk.create_app.webhook" + span_name = "create_app.webhook" if tracer_provider is None: tracer = trace.get_tracer(span_name) context = None diff --git a/tests/tracing/test_utils.py b/tests/tracing/test_utils.py index a49ab7dd3..a0ece6cea 100644 --- a/tests/tracing/test_utils.py +++ b/tests/tracing/test_utils.py @@ -73,5 +73,5 @@ def test_get_tracer_and_context() -> None: print(type(tracer)) assert isinstance(tracer, ProxyTracer) - assert span_name == "rasa_sdk.create_app.webhook" + assert span_name == "create_app.webhook" assert context is None