exporters

package
v0.0.0-...-89602ce Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package exporters provides an interface for converting protobuf metrics to timeseries datapoints and writing these datapoints to storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeProtoMetric

func MakeProtoMetric(m MetricAndContext) *protos.ContextualizedMetric

MakeProtoMetric converts native contextualized metric to proto.

func MakeProtoMetrics

func MakeProtoMetrics(metrics []MetricAndContext) []*protos.ContextualizedMetric

MakeProtoMetrics converts native contextualized metrics to protos.

Types

type AdditionalMetricContext

type AdditionalMetricContext interface {
	// contains filtered or unexported methods
}

type ByName

type ByName []*prometheus_models.LabelPair

ByName is an interface for sorting LabelPairs by name

func (ByName) Len

func (a ByName) Len() int

func (ByName) Less

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

func (ByName) Swap

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

type CloudMetricContext

type CloudMetricContext struct {
	// CloudHost is the hostname of the cloud host which originated the metric.
	CloudHost string
}

type Exporter

type Exporter interface {
	// Submit metrics to the exporter.
	// This method must be thread-safe.
	Submit(metrics []MetricAndContext) error
}

Exporter exports metrics received by the metricsd servicer to a datasink.

func NewRemoteExporter

func NewRemoteExporter(serviceName string) Exporter

type GatewayMetricContext

type GatewayMetricContext struct {
	NetworkID string
	GatewayID string
}

type MetricAndContext

type MetricAndContext struct {
	Family  *prometheus_models.MetricFamily
	Context MetricContext
}

MetricAndContext wraps a metric family and metric context

func MakeNativeMetric

func MakeNativeMetric(p *protos.ContextualizedMetric) MetricAndContext

MakeNativeMetric converts proto to native contextualized metric.

func MakeNativeMetrics

func MakeNativeMetrics(protoMetrics []*protos.ContextualizedMetric) []MetricAndContext

MakeNativeMetrics converts protos to native contextualized metrics.

type MetricContext

type MetricContext struct {
	MetricName        string
	AdditionalContext AdditionalMetricContext
}

MetricContext provides information to the exporter about where this metric comes from.

type PushedMetricContext

type PushedMetricContext struct {
	NetworkID string
}

type Sample

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

Sample is a flattened version of a metric providing a single name-value pairing, with accompanying metadata and labels.

func GetSamplesForMetrics

func GetSamplesForMetrics(metricAndContext *protos.ContextualizedMetric, metric *prometheus_models.Metric) []Sample

GetSamplesForMetrics takes a Metric protobuf and extracts Samples from them since there may be multiple Samples per a single Metric instance

func NewSample

func NewSample(name string, value string, timestampMs int64, labels []*prometheus_models.LabelPair, entity string) Sample

func (*Sample) Entity

func (s *Sample) Entity() string

func (*Sample) Labels

func (s *Sample) Labels() []*prometheus_models.LabelPair

func (*Sample) Name

func (s *Sample) Name() string

func (*Sample) TimestampMs

func (s *Sample) TimestampMs() int64

func (*Sample) Value

func (s *Sample) Value() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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