Documentation
¶
Overview ¶
Package telemetry provides OpenTelemetry SDK setup for tracing and metrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
ServiceName string
ServiceVersion string
TraceWriter io.Writer // nil = discard (used when no OTLP endpoint)
MetricWriter io.Writer // nil = discard (used when Prometheus is disabled)
// OTLP exporter settings (empty = use stdout fallback)
OTLPEndpoint string // gRPC endpoint, e.g. "localhost:4317"
OTLPInsecure bool // use insecure connection (no TLS)
// Prometheus metrics (when enabled, exposes /metrics for scraping)
PrometheusEnabled bool
}
Config holds optional settings for telemetry initialization.
type Result ¶
type Result struct {
Shutdown func(context.Context) error
PrometheusHandler *prometheus.Exporter // nil when Prometheus is disabled
}
Result holds references needed after Init (e.g. Prometheus handler).
Click to show internal directories.
Click to hide internal directories.