inference/research
verifiedhigh · 0.94updated 2026-10-05

TEI router/src/http/server.rs - per-route OTel spans with parent-context propagation

repo

Fields

id
sources/w5e-tei-router-server-rs-spans
Publisher
huggingface
Kind
repo
Accessed
2026-10-05
notes
Read at main 2026-10-05. Each HTTP handler (predict, rerank, embed, embed_sparse, embed_all, similarity, openai_embed) carries #[instrument(skip_all, fields(total_time, tokenization_time, queue_time, inference_time))] and takes Extension<Option<opentelemetry::Context>> then calls span.set_parent(context) - so incoming W3C trace context is honoured. router/src/lib.rs (line ~651) records those four fields onto the span in the completion callback via span.record(...). router/src/logging.rs installs the OTLP gRPC pipeline; main.rs exposes --otlp-endpoint, --otlp-service-name and --disable-spans.

Notes

Read at main 2026-10-05. Each HTTP handler (predict, rerank, embed, embed_sparse, embed_all, similarity, openai_embed) carries #[instrument(skip_all, fields(total_time, tokenization_time, queue_time, inference_time))] and takes Extension<Option<opentelemetry::Context>> then calls span.set_parent(context) - so incoming W3C trace context is honoured. router/src/lib.rs (line ~651) records those four fields onto the span in the completion callback via span.record(...). router/src/logging.rs installs the OTLP gRPC pipeline; main.rs exposes --otlp-endpoint, --otlp-service-name and --disable-spans.

Cross-references

This record references no other records.