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))