prometheusremotewrite

package module
v0.60.1-0...-3bf9d78 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromMetrics

func FromMetrics(md pmetric.Metrics, settings Settings) (tsMap map[string]*prompb.TimeSeries, errs error)

FromMetrics converts pmetric.Metrics to prometheus remote write format.

func FromTimeSeries

func FromTimeSeries(tss []prompb.TimeSeries, settings Settings) (pmetric.Metrics, error)

func IsValidCumulativeSuffix

func IsValidCumulativeSuffix(suffix string) bool

IsValidCumulativeSuffix - remote write

func IsValidSuffix

func IsValidSuffix(suffix string) bool

IsValidSuffix - remote write

func IsValidUnit

func IsValidUnit(unit string) bool

IsValidUnit - remote write

func MetricsToPRW deprecated

func MetricsToPRW(namespace string, externalLabels map[string]string, md pmetric.Metrics) (map[string]*prompb.TimeSeries, int, error)

Deprecated: [0.45.0] use `prometheusremotewrite.FromMetrics`. It does not wrap the error as `NewPermanent`.

Types

type ByLabelName

type ByLabelName []prompb.Label

ByLabelName enables the usage of sort.Sort() with a slice of labels

func (ByLabelName) Len

func (a ByLabelName) Len() int

func (ByLabelName) Less

func (a ByLabelName) Less(i, j int) bool

func (ByLabelName) Swap

func (a ByLabelName) Swap(i, j int)

type Settings

type Settings struct {
	Namespace         string
	ExternalLabels    map[string]string
	DisableTargetInfo bool
	TimeThreshold     int64
	Logger            zap.Logger
}

Jump to

Keyboard shortcuts

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