Documentation
¶
Overview ¶
Package telemetry provides OpenTelemetry tracing initialization for standalone kv-cache services.
IMPORTANT: When llm-d-kv-cache is used as a library (e.g., bundled into llm-d-router), the library code uses otel.Tracer() directly to access the global tracer provider initialized by the parent application. This package is only used for standalone examples and services.
Index ¶
Constants ¶
const (
// InstrumentationName identifies this instrumentation library in traces.
InstrumentationName = "llm-d-kv-cache"
)
Variables ¶
This section is empty.
Functions ¶
func InitTracing ¶
InitTracing initializes OpenTelemetry tracing. Configuration is done via environment variables: - OTEL_SERVICE_NAME: Service name (default: llm-d-kv-cache) - OTEL_TRACES_EXPORTER: Span exporter, "otlp" or "console" (default: otlp) - OTEL_EXPORTER_OTLP_ENDPOINT: OTLP collector endpoint (default: http://localhost:4317) - OTEL_TRACES_SAMPLER: Sampling strategy (default: parentbased_traceidratio) - OTEL_TRACES_SAMPLER_ARG: Sampling ratio (default: 0.1 for 10%).
func Tracer ¶
Tracer returns a tracer for the given instrumentation scope, defaulting to InstrumentationName. Build version and commit SHA are attached so every span in a trace carries consistent scope metadata. When used as a library, the host application's tracer provider determines the service name.
Types ¶
This section is empty.