telemetry

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

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

View Source
const (

	// InstrumentationName identifies this instrumentation library in traces.
	InstrumentationName = "llm-d-kv-cache"
)

Variables

This section is empty.

Functions

func InitTracing

func InitTracing(ctx context.Context) (func(context.Context) error, error)

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

func Tracer(scope ...string) trace.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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL