prometheus_output

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricNameRegex = regexp.MustCompile(metricNameRegex)
)

Functions

This section is empty.

Types

type MetricBuilder

type MetricBuilder struct {
	Prefix                 string
	AppendSubscriptionName bool
	StringsAsLabels        bool
	OverrideTimestamps     bool
	ExportTimestamps       bool
}

func (*MetricBuilder) GetLabels

func (m *MetricBuilder) GetLabels(ev *formatters.EventMsg) []prompb.Label

func (*MetricBuilder) MetricName

func (m *MetricBuilder) MetricName(measName, valueName string) string

MetricName generates the prometheus metric name based on the output plugin, the measurement name and the value name. it makes sure the name matches the regex "[^a-zA-Z0-9_]+"

func (*MetricBuilder) MetricsFromEvent added in v0.37.0

func (mb *MetricBuilder) MetricsFromEvent(ev *formatters.EventMsg, now time.Time) []*PromMetric

func (*MetricBuilder) TimeSeriesFromEvent

func (m *MetricBuilder) TimeSeriesFromEvent(ev *formatters.EventMsg) []*NamedTimeSeries

type NamedTimeSeries

type NamedTimeSeries struct {
	Name string
	TS   *prompb.TimeSeries
}

type PromMetric added in v0.37.0

type PromMetric struct {
	Name string
	Time *time.Time
	// AddedAt is used to expire metrics if the time field is not initialized
	// this happens when ExportTimestamp == false
	AddedAt time.Time
	// contains filtered or unexported fields
}

func (*PromMetric) CalculateKey added in v0.37.0

func (p *PromMetric) CalculateKey() uint64

Metric

func (*PromMetric) Desc added in v0.37.0

func (p *PromMetric) Desc() *prometheus.Desc

Desc implements prometheus.Metric

func (*PromMetric) String added in v0.37.0

func (p *PromMetric) String() string

func (*PromMetric) Write added in v0.37.0

func (p *PromMetric) Write(out *dto.Metric) error

Write implements prometheus.Metric

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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