Skip to content

Commit

Permalink
rename service name
Browse files Browse the repository at this point in the history
  • Loading branch information
Tawakalt committed Feb 7, 2024
1 parent 33b8fa4 commit 8c0dea8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions rasa_sdk/tracing/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion rasa_sdk/tracing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/tracing/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8c0dea8

Please sign in to comment.