prometheus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package prometheus implements a translator to convert prometheus metrics to OTLP metrics. The translation is expected to work with the envoy metricsserver which emits all metrics as prometheus protobufs. Counters should be cumulative and only gauges, counters and histograms are translated.

Histograms that are emitted by the envoy metrics server are delta histograms instead of cumulative

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder is an OTLP metric builder.

func NewBuilder

func NewBuilder(identityLabels map[string]string) *Builder

NewBuilder creates a new OTLP metric builder to convert prometheus metrics to OTLP metrics.

func (*Builder) AddCounter

func (b *Builder) AddCounter(family *prompb.MetricFamily)

AddCounter converts a prometheus counter to an OTLP monotonic Sum and adds it to the metrics builder.

func (*Builder) AddGauge

func (b *Builder) AddGauge(family *prompb.MetricFamily)

AddGauge converts a prometheus gauge to an OTLP Gauge and adds it to the metrics builder.

func (*Builder) AddHistogram

func (b *Builder) AddHistogram(family *prompb.MetricFamily)

AddHistogram converts a prometheus histogram to an OTLP histogram.

func (*Builder) Build

func (b *Builder) Build() pmetric.Metrics

Build adds converted metrics to a new pmetric.Metrics.

Jump to

Keyboard shortcuts

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