From 6632428909c71b5fd2dd79bab2a6e3c4b6a58c03 Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Thu, 7 Nov 2024 15:05:20 -0800 Subject: [PATCH] better naming --- arch/envoy.template.yaml | 4 ++-- model_server/app/main.py | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/envoy.template.yaml b/arch/envoy.template.yaml index 9e46786b..cce4e1b1 100644 --- a/arch/envoy.template.yaml +++ b/arch/envoy.template.yaml @@ -78,7 +78,7 @@ static_resources: envoy_grpc: cluster_name: opentelemetry_collector timeout: 0.250s - service_name: arch_internal + service_name: prompt_processor random_sampling: value: {{ arch_tracing.random_sampling }} {% endif %} @@ -191,7 +191,7 @@ static_resources: envoy_grpc: cluster_name: opentelemetry_collector timeout: 0.250s - service_name: arch_internal + service_name: prompt_processor random_sampling: value: {{ arch_tracing.random_sampling }} {% endif %} diff --git a/model_server/app/main.py b/model_server/app/main.py index 58823db9..1fd34b96 100644 --- a/model_server/app/main.py +++ b/model_server/app/main.py @@ -42,10 +42,14 @@ app = FastAPI() FastAPIInstrumentor().instrument_app(app) +# DEFAULT_OTLP_HOST = "http://localhost:4317" +DEFAULT_OTLP_HOST = "none" + # Configure the OTLP exporter (Jaeger, Zipkin, etc.) otlp_exporter = OTLPSpanExporter( - endpoint=os.getenv("OLTP_HOST", "http://localhost:4317") # noqa: F821 + endpoint=os.getenv("OTLP_HOST", DEFAULT_OTLP_HOST) # noqa: F821 ) + trace.get_tracer_provider().add_span_processor(BatchSpanProcessor(otlp_exporter))