Documentation
¶
Overview ¶
Package meldotel exports sampled Meldbase statistics through OpenTelemetry metrics.
It never calls DB.Stats directly and does not create an SDK, exporter, goroutine, network connection, or global state.
Index ¶
Constants ¶
const SchemaVersion uint32 = 12
SchemaVersion identifies the fixed set of exported metrics and their meanings.
It is independent of the admin JSON schema and OpenTelemetry API version.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter exports the latest admin sample through registered OpenTelemetry instruments.
func New ¶
func New(source SampleSource, options Options) (*Adapter, error)
New registers the fixed metric set and a callback that reads the supplied sample source.
func (*Adapter) Close ¶
Close unregisters the collection callback once and returns any unregister error.
func (*Adapter) Stats ¶
func (adapter *Adapter) Stats() AdapterStats
Stats returns the adapter counters and closed state.
type AdapterStats ¶
AdapterStats reports collection attempts, unavailable samples, and clamped measurements.
type InstrumentDescriptor ¶
type InstrumentDescriptor struct {
Name string
Description string
Unit string
Kind InstrumentKind
Number string
}
InstrumentDescriptor describes a metric name, meaning, unit, and numeric kind.
func Instruments ¶
func Instruments() []InstrumentDescriptor
Instruments returns a fresh copy of the exported metric definitions.
Definitions never contain application, collection, query, document, actor, or workspace data.
type InstrumentKind ¶
type InstrumentKind string
InstrumentKind distinguishes gauges from cumulative counters.
const ( // InstrumentGauge identifies a measurement of the current state. InstrumentGauge InstrumentKind = "gauge" // InstrumentCounter identifies a cumulative measurement. InstrumentCounter InstrumentKind = "counter" )
type Options ¶
type Options struct {
MeterProvider metric.MeterProvider
InstrumentationVersion string
}
Options selects the meter provider and optional instrumentation version.
type SampleSource ¶
SampleSource supplies the latest stored admin sample for metric collection.
*admin.Sampler implements this interface. The adapter reads its latest immutable sample without entering a database lock from a collection callback.