Docs

Observability (OTel)

Send Schift retrieval traces to LangSmith, Datadog, Sentry, Helicone, Honeycomb, or any OTLP-compatible backend.

Schift API and worker emit OpenTelemetry spans for every retrieval call (embedding, vector search, BM25, rerank, LLM dispatch). Any OTLP-compatible backend can ingest them by setting three environment variables.

Quick start

bashexport OTEL_EXPORTER_OTLP_ENDPOINT="<vendor endpoint>"
export OTEL_EXPORTER_OTLP_HEADERS="<vendor auth header>"
# Optional — auto-detected to http/protobuf for HTTPS endpoints
export OTEL_EXPORTER_OTLP_PROTOCOL="http/protobuf"

Vendor endpoints

VendorEndpointAuth header
LangSmithhttps://api.smith.langchain.com/otelx-api-key=<langsmith-key>
Datadog (agent)http://datadog-agent:4318(none — IAM/network)
Datadog (direct)https://trace.agent.datadoghq.comdd-api-key=<key>
Sentryhttps://o<org>.ingest.sentry.io/api/<project>/otlp/v1/tracesx-sentry-auth=sentry_key=<public-key>
Heliconehttps://api.helicone.ai/otel/v1/tracesauthorization=Bearer <key>
Honeycombhttps://api.honeycomb.iox-honeycomb-team=<key>,x-honeycomb-dataset=schift
Tempo / Jaegerhttp://collector:4318(none)

Custom span attributes

Every Schift retrieval span carries:

AttributeTypeExample
schift.bucket.idstringbkt_abc123
schift.search.top_kint10
schift.search.modestringvector / hybrid
schift.search.methodstringengine_hybrid / hyde / fallback
schift.search.rerankbooltrue
schift.search.results.countint8
schift.search.scores.topfloat0.91
schift.search.scores.avgfloat0.74
schift.filter.keysstring[]["tag","source_url"]
schift.filter.opsstring[]["eq","like"]
schift.timing.total_msint186
schift.search_idstringsearch_<hex>

Sampling

High-volume deployments should sample to control cost:

bashexport OTEL_TRACES_SAMPLER=parentbased_traceidratio
export OTEL_TRACES_SAMPLER_ARG=0.1   # 10% sampling

Detailed guides

See /docs/observability/langsmith and /docs/observability/vendors for vendor-specific walkthroughs including sampling strategies and trace correlation.