Documentation ¶
Overview ¶
Package exporters provides an interface for converting protobuf metrics to timeseries datapoints and writing these datapoints to storage.
Index ¶
- func MakeProtoMetric(m MetricAndContext) *protos.ContextualizedMetric
- func MakeProtoMetrics(metrics []MetricAndContext) []*protos.ContextualizedMetric
- type AdditionalMetricContext
- type ByName
- type CloudMetricContext
- type Exporter
- type GatewayMetricContext
- type MetricAndContext
- type MetricContext
- type PushedMetricContext
- type Sample
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
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 ¶
type GatewayMetricContext ¶
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 (*Sample) Labels ¶
func (s *Sample) Labels() []*prometheus_models.LabelPair