Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// OTLPEnabled controls whether metrics are pushed to an OTLP endpoint.
OTLPEnabled bool
// OTLPEndpoint is the base URL of the OTLP HTTP receiver (e.g. "http://localhost:4318").
OTLPEndpoint string
// OTLPInterval is how often metrics are pushed to the OTLP endpoint.
OTLPInterval time.Duration
}
Config holds telemetry configuration.
type MetadataStats ¶
type MetadataStats struct {
CacheGets uint64
CacheMisses uint64
CacheEntries uint64
DBSizeBytes int64
}
MetadataStats is a snapshot of metadata subsystem metrics captured at scrape time.
type Provider ¶
type Provider struct {
// PrometheusHTTP is the HTTP handler that serves Prometheus-format metrics.
PrometheusHTTP http.Handler
// contains filtered or unexported fields
}
Provider wraps the OTel MeterProvider and exposes the Prometheus HTTP handler.
func Setup ¶
Setup initializes the OTel MeterProvider with a Prometheus pull reader and, when cfg.OTLPEnabled is true, an OTLP HTTP push reader. It also sets the global OTel MeterProvider so that otelhttp and other libraries pick it up.
func (*Provider) MeterProvider ¶
func (p *Provider) MeterProvider() metric.MeterProvider
MeterProvider returns the underlying OTel MeterProvider.
func (*Provider) RegisterMetadataObservers ¶
func (p *Provider) RegisterMetadataObservers(stats func() MetadataStats) error
RegisterMetadataObservers wires up observable instruments that read from the metadata subsystem at each scrape/push interval. Call this after both the Provider and the metadata Manager are initialised.