Documentation
¶
Overview ¶
Package convert implements conversion utilities to convert between OpenTelemetry Collector data and Prometheus data.
It follows the OpenTelemetry Metrics Data Model for implementing the conversion.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter struct {
// contains filtered or unexported fields
}
Converter implements consumer.Metrics and converts received metrics into Prometheus-compatible metrics.
func New ¶
New returns a new Converter. Converted metrics are passed to the provided storage.Appendable implementation.
func (*Converter) Capabilities ¶
func (conv *Converter) Capabilities() consumer.Capabilities
Capabilities implements consumer.Metrics.
func (*Converter) ConsumeMetrics ¶
ConsumeMetrics converts the provided OpenTelemetry Collector-formatted metrics into Prometheus-compatible metrics. Each call to ConsumeMetrics requests a storage.Appender and will commit generated metrics to it at the end of the call.
Metrics are tracked in memory over time. Call *Converter.GC to clean up stale metrics.
func (*Converter) FlushMetadata ¶
func (conv *Converter) FlushMetadata()
FlushMetadata empties out the metadata cache, forcing metadata to get rewritten.
func (*Converter) GC ¶
GC cleans up stale metrics which have not been updated in the time specified by staleTime.
func (*Converter) UpdateOptions ¶
UpdateOptions updates the options for the Converter.
type Options ¶
type Options struct { // IncludeTargetInfo includes the target_info metric. IncludeTargetInfo bool // IncludeScopeInfo includes the otel_scope_info metric and adds // otel_scope_name and otel_scope_version labels to data points. IncludeScopeInfo bool // IncludeScopeLabels includes the otel_scope_name and otel_scope_version // labels from the scope in the metrics. IncludeScopeLabels bool }
Options configure a Converter.