SGLang sgl-model-gateway/src/observability/otel_trace.rs - the Rust gateway's OTLP tracing setup and target filter
repo
Fields
id
sources/w5e-sglang-model-gateway-otelURL
Publisher
sgl-project
Kind
repo
Accessed
2026-10-05
notes
Read at main 2026-10-05 (v0.5.21, 2026-10-02). The Rust router, not the Python one, is what ships as sglang_router. otel_tracing_init(enable, otlp_endpoint) defaults the endpoint to localhost:4317, forces http:// if no scheme, sets a TraceContextPropagator, and builds a BatchSpanProcessor with a 500 ms scheduled delay and max batch 64. CustomOtelFilter restricts export to three module targets: smg::otel-trace, smg::observability::otel_trace and the events module path - so a span only reaches the collector if it is raised under one of those targets.
Notes
Read at main 2026-10-05 (v0.5.21, 2026-10-02). The Rust router, not the Python one, is what ships as sglang_router. otel_tracing_init(enable, otlp_endpoint) defaults the endpoint to localhost:4317, forces http:// if no scheme, sets a TraceContextPropagator, and builds a BatchSpanProcessor with a 500 ms scheduled delay and max batch 64. CustomOtelFilter restricts export to three module targets: smg::otel-trace, smg::observability::otel_trace and the events module path - so a span only reaches the collector if it is raised under one of those targets.
Cross-references
This record references no other records.