openmetrics

package
v1.31.3 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 25 Imported by: 0

README

OpenMetrics Format Parser Plugin

This plugin allows to parse the OpenMetrics Text Format into Telegraf metrics. It is used internally in prometheus input but can also be used by e.g. http_listener_v2 to simulate a Pushgateway.

The plugin allows to output different metric formats as described in the Metric Formats section.

Configuration

[[inputs.file]]
  files = ["example"]

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ##   https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "openmetrics"

Metric Formats

The metric_version setting controls how telegraf translates OpenMetrics' metrics to Telegraf metrics. There are two options.

v1 format

In this version, the OpenMetrics metric-family name becomes the Telegraf metric name, labels become tags and values become fields. The fields are named based on the type of the OpenMetric metric. This option produces metrics that are dense (contrary to the sparse metrics ofv2).

Example:

# TYPE acme_http_router_request_seconds summary
# UNIT acme_http_router_request_seconds seconds
# HELP acme_http_router_request_seconds Latency though all of ACME's HTTP request router.
acme_http_router_request_seconds_sum{path="/api/v1",method="GET"} 9036.32
acme_http_router_request_seconds_count{path="/api/v1",method="GET"} 807283.0
acme_http_router_request_seconds{path="/api/v1",method="GET",quantile="0.5"} 1.29854
acme_http_router_request_seconds{path="/api/v1",method="GET",quantile="0.9"} 54.85479
acme_http_router_request_seconds{path="/api/v1",method="GET",quantile="0.99"} 6884.32324
acme_http_router_request_seconds_created{path="/api/v1",method="GET"} 1605281325.0
acme_http_router_request_seconds_sum{path="/api/v2",method="POST"} 479.3
acme_http_router_request_seconds_count{path="/api/v2",method="POST"} 34.0
acme_http_router_request_seconds_created{path="/api/v2",method="POST"} 1605281325.0
acme_http_router_request_seconds{path="/api/v2",method="POST",quantile="0.5"} 0.85412
acme_http_router_request_seconds{path="/api/v2",method="POST",quantile="0.9"} 1.15429
acme_http_router_request_seconds{path="/api/v2",method="POST",quantile="0.99"} 3698.48132
# TYPE go_goroutines gauge
# HELP go_goroutines Number of goroutines that currently exist.
go_goroutines 69
# TYPE process_cpu_seconds counter
# UNIT process_cpu_seconds seconds
# HELP process_cpu_seconds Total user and system CPU time spent in seconds.
process_cpu_seconds_total 4.20072246e+06
# EOF```

becomes

```text
acme_http_router_request_seconds,unit=seconds,path=/api/v1,method=GET sum=9036.32,count=807283.0,created=1605281325.0,0.5=1.29854,0.9=54.85479,0.99=6884.32324
acme_http_router_request_seconds,unit=seconds,path=/api/v2,method=POST sum=479.3,count=34.0,created=1605281325.0,0.5=0.85412,0.9=1.15429,0.99=3698.48132
go_goroutines gauge=69
process_cpu_seconds,unit=seconds counter=4200722.46

This is especially useful and efficient for outputs with row-oriented data models.

v2 format

In this version, each OpenMetrics MetricPoint becomes a Telegraf metric with a few exceptions for complex types like histograms. All Telegraf metrics are named prometheus with OpenMetrics' labels become tags and the field-name is based on the OpenMetrics metric-name.

Example:

Example:

# TYPE acme_http_router_request_seconds summary
# UNIT acme_http_router_request_seconds seconds
# HELP acme_http_router_request_seconds Latency though all of ACME's HTTP request router.
acme_http_router_request_seconds_sum{path="/api/v1",method="GET"} 9036.32
acme_http_router_request_seconds_count{path="/api/v1",method="GET"} 807283.0
acme_http_router_request_seconds{path="/api/v1",method="GET",quantile="0.5"} 1.29854
acme_http_router_request_seconds{path="/api/v1",method="GET",quantile="0.9"} 54.85479
acme_http_router_request_seconds{path="/api/v1",method="GET",quantile="0.99"} 6884.32324
acme_http_router_request_seconds_created{path="/api/v1",method="GET"} 1605281325.0
acme_http_router_request_seconds_sum{path="/api/v2",method="POST"} 479.3
acme_http_router_request_seconds_count{path="/api/v2",method="POST"} 34.0
acme_http_router_request_seconds_created{path="/api/v2",method="POST"} 1605281325.0
acme_http_router_request_seconds{path="/api/v2",method="POST",quantile="0.5"} 0.85412
acme_http_router_request_seconds{path="/api/v2",method="POST",quantile="0.9"} 1.15429
acme_http_router_request_seconds{path="/api/v2",method="POST",quantile="0.99"} 3698.48132
# TYPE go_goroutines gauge
# HELP go_goroutines Number of goroutines that currently exist.
go_goroutines 69
# TYPE process_cpu_seconds counter
# UNIT process_cpu_seconds seconds
# HELP process_cpu_seconds Total user and system CPU time spent in seconds.
process_cpu_seconds_total 4.20072246e+06
# EOF```

becomes

```text
prometheus,method=GET,path=/api/v1,unit=seconds acme_http_router_request_seconds_count=807283,acme_http_router_request_seconds_created=1605281325,acme_http_router_request_seconds_sum=9036.32
prometheus,method=GET,path=/api/v1,quantile=0.5,unit=seconds acme_http_router_request_seconds=1.29854
prometheus,method=GET,path=/api/v1,quantile=0.9,unit=seconds acme_http_router_request_seconds=54.85479
prometheus,method=GET,path=/api/v1,quantile=0.99,unit=seconds acme_http_router_request_seconds=6884.32324
prometheus,method=POST,path=/api/v2,unit=seconds acme_http_router_request_seconds_count=34,acme_http_router_request_seconds_created=1605281325,acme_http_router_request_seconds_sum=479.3
prometheus,method=POST,path=/api/v2,quantile=0.5,unit=seconds acme_http_router_request_seconds=0.85412
prometheus,method=POST,path=/api/v2,quantile=0.9,unit=seconds acme_http_router_request_seconds=1.15429
prometheus,method=POST,path=/api/v2,quantile=0.99,unit=seconds acme_http_router_request_seconds=3698.48132
prometheus go_goroutines=69
prometheus,unit=seconds process_cpu_seconds=4200722.46

The resulting metrics are sparse, but for some outputs they may be easier to process or query, including those that are more efficient with column-oriented data. The telegraf metric name is the same for all metrics in the input instance. It can be set with the name_override setting and defaults to "prometheus". To have multiple metric names, you can use multiple instances of the plugin, each with its own name_override.

metric_version = 2 uses the same histogram format as the histogram aggregator

Regenerating OpenMetrics code

Download the latest version of the protocol-buffer definition

wget https://raw.githubusercontent.com/OpenObservability/OpenMetrics/main/proto/openmetrics_data_model.proto

and generate the go-code for the definition using

protoc --proto_path=. \
       --go_out=. \
       --go_opt=paths=source_relative \
       --go_opt=Mopenmetrics_data_model.proto=github.com/influxdata/telegraf/plugins/parsers/openmetrics \
       openmetrics_data_model.proto

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MetricType_name = map[int32]string{
		0: "UNKNOWN",
		1: "GAUGE",
		2: "COUNTER",
		3: "STATE_SET",
		4: "INFO",
		5: "HISTOGRAM",
		6: "GAUGE_HISTOGRAM",
		7: "SUMMARY",
	}
	MetricType_value = map[string]int32{
		"UNKNOWN":         0,
		"GAUGE":           1,
		"COUNTER":         2,
		"STATE_SET":       3,
		"INFO":            4,
		"HISTOGRAM":       5,
		"GAUGE_HISTOGRAM": 6,
		"SUMMARY":         7,
	}
)

Enum value maps for MetricType.

View Source
var File_openmetrics_data_model_proto protoreflect.FileDescriptor

Functions

func AcceptsContent

func AcceptsContent(header http.Header) bool

Types

type CounterValue

type CounterValue struct {

	// Required.
	//
	// Types that are assignable to Total:
	//
	//	*CounterValue_DoubleValue
	//	*CounterValue_IntValue
	Total isCounterValue_Total `protobuf_oneof:"total"`
	// The time values began being collected for this counter.
	// Optional.
	Created *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=created,proto3" json:"created,omitempty"`
	// Optional.
	Exemplar *Exemplar `protobuf:"bytes,4,opt,name=exemplar,proto3" json:"exemplar,omitempty"`
	// contains filtered or unexported fields
}

Value for COUNTER MetricPoint.

func (*CounterValue) Descriptor deprecated

func (*CounterValue) Descriptor() ([]byte, []int)

Deprecated: Use CounterValue.ProtoReflect.Descriptor instead.

func (*CounterValue) GetCreated

func (x *CounterValue) GetCreated() *timestamppb.Timestamp

func (*CounterValue) GetDoubleValue

func (x *CounterValue) GetDoubleValue() float64

func (*CounterValue) GetExemplar

func (x *CounterValue) GetExemplar() *Exemplar

func (*CounterValue) GetIntValue

func (x *CounterValue) GetIntValue() uint64

func (*CounterValue) GetTotal

func (m *CounterValue) GetTotal() isCounterValue_Total

func (*CounterValue) ProtoMessage

func (*CounterValue) ProtoMessage()

func (*CounterValue) ProtoReflect

func (x *CounterValue) ProtoReflect() protoreflect.Message

func (*CounterValue) Reset

func (x *CounterValue) Reset()

func (*CounterValue) String

func (x *CounterValue) String() string

type CounterValue_DoubleValue

type CounterValue_DoubleValue struct {
	DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"`
}

type CounterValue_IntValue

type CounterValue_IntValue struct {
	IntValue uint64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"`
}

type Exemplar

type Exemplar struct {

	// Required.
	Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	// Optional.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// Labels are additional information about the exemplar value (e.g. trace id).
	// Optional.
	Label []*Label `protobuf:"bytes,3,rep,name=label,proto3" json:"label,omitempty"`
	// contains filtered or unexported fields
}

func (*Exemplar) Descriptor deprecated

func (*Exemplar) Descriptor() ([]byte, []int)

Deprecated: Use Exemplar.ProtoReflect.Descriptor instead.

func (*Exemplar) GetLabel

func (x *Exemplar) GetLabel() []*Label

func (*Exemplar) GetTimestamp

func (x *Exemplar) GetTimestamp() *timestamppb.Timestamp

func (*Exemplar) GetValue

func (x *Exemplar) GetValue() float64

func (*Exemplar) ProtoMessage

func (*Exemplar) ProtoMessage()

func (*Exemplar) ProtoReflect

func (x *Exemplar) ProtoReflect() protoreflect.Message

func (*Exemplar) Reset

func (x *Exemplar) Reset()

func (*Exemplar) String

func (x *Exemplar) String() string

type GaugeValue

type GaugeValue struct {

	// Required.
	//
	// Types that are assignable to Value:
	//
	//	*GaugeValue_DoubleValue
	//	*GaugeValue_IntValue
	Value isGaugeValue_Value `protobuf_oneof:"value"`
	// contains filtered or unexported fields
}

Value for GAUGE MetricPoint.

func (*GaugeValue) Descriptor deprecated

func (*GaugeValue) Descriptor() ([]byte, []int)

Deprecated: Use GaugeValue.ProtoReflect.Descriptor instead.

func (*GaugeValue) GetDoubleValue

func (x *GaugeValue) GetDoubleValue() float64

func (*GaugeValue) GetIntValue

func (x *GaugeValue) GetIntValue() int64

func (*GaugeValue) GetValue

func (m *GaugeValue) GetValue() isGaugeValue_Value

func (*GaugeValue) ProtoMessage

func (*GaugeValue) ProtoMessage()

func (*GaugeValue) ProtoReflect

func (x *GaugeValue) ProtoReflect() protoreflect.Message

func (*GaugeValue) Reset

func (x *GaugeValue) Reset()

func (*GaugeValue) String

func (x *GaugeValue) String() string

type GaugeValue_DoubleValue

type GaugeValue_DoubleValue struct {
	DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"`
}

type GaugeValue_IntValue

type GaugeValue_IntValue struct {
	IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"`
}

type HistogramValue

type HistogramValue struct {

	// Optional.
	//
	// Types that are assignable to Sum:
	//
	//	*HistogramValue_DoubleValue
	//	*HistogramValue_IntValue
	Sum isHistogramValue_Sum `protobuf_oneof:"sum"`
	// Optional.
	Count uint64 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	// The time values began being collected for this histogram.
	// Optional.
	Created *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"`
	// Optional.
	Buckets []*HistogramValue_Bucket `protobuf:"bytes,5,rep,name=buckets,proto3" json:"buckets,omitempty"`
	// contains filtered or unexported fields
}

Value for HISTOGRAM or GAUGE_HISTOGRAM MetricPoint.

func (*HistogramValue) Descriptor deprecated

func (*HistogramValue) Descriptor() ([]byte, []int)

Deprecated: Use HistogramValue.ProtoReflect.Descriptor instead.

func (*HistogramValue) GetBuckets

func (x *HistogramValue) GetBuckets() []*HistogramValue_Bucket

func (*HistogramValue) GetCount

func (x *HistogramValue) GetCount() uint64

func (*HistogramValue) GetCreated

func (x *HistogramValue) GetCreated() *timestamppb.Timestamp

func (*HistogramValue) GetDoubleValue

func (x *HistogramValue) GetDoubleValue() float64

func (*HistogramValue) GetIntValue

func (x *HistogramValue) GetIntValue() int64

func (*HistogramValue) GetSum

func (m *HistogramValue) GetSum() isHistogramValue_Sum

func (*HistogramValue) ProtoMessage

func (*HistogramValue) ProtoMessage()

func (*HistogramValue) ProtoReflect

func (x *HistogramValue) ProtoReflect() protoreflect.Message

func (*HistogramValue) Reset

func (x *HistogramValue) Reset()

func (*HistogramValue) String

func (x *HistogramValue) String() string

type HistogramValue_Bucket

type HistogramValue_Bucket struct {

	// Required.
	Count uint64 `protobuf:"varint,1,opt,name=count,proto3" json:"count,omitempty"`
	// Optional.
	UpperBound float64 `protobuf:"fixed64,2,opt,name=upper_bound,json=upperBound,proto3" json:"upper_bound,omitempty"`
	// Optional.
	Exemplar *Exemplar `protobuf:"bytes,3,opt,name=exemplar,proto3" json:"exemplar,omitempty"`
	// contains filtered or unexported fields
}

Bucket is the number of values for a bucket in the histogram with an optional exemplar.

func (*HistogramValue_Bucket) Descriptor deprecated

func (*HistogramValue_Bucket) Descriptor() ([]byte, []int)

Deprecated: Use HistogramValue_Bucket.ProtoReflect.Descriptor instead.

func (*HistogramValue_Bucket) GetCount

func (x *HistogramValue_Bucket) GetCount() uint64

func (*HistogramValue_Bucket) GetExemplar

func (x *HistogramValue_Bucket) GetExemplar() *Exemplar

func (*HistogramValue_Bucket) GetUpperBound

func (x *HistogramValue_Bucket) GetUpperBound() float64

func (*HistogramValue_Bucket) ProtoMessage

func (*HistogramValue_Bucket) ProtoMessage()

func (*HistogramValue_Bucket) ProtoReflect

func (x *HistogramValue_Bucket) ProtoReflect() protoreflect.Message

func (*HistogramValue_Bucket) Reset

func (x *HistogramValue_Bucket) Reset()

func (*HistogramValue_Bucket) String

func (x *HistogramValue_Bucket) String() string

type HistogramValue_DoubleValue

type HistogramValue_DoubleValue struct {
	DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"`
}

type HistogramValue_IntValue

type HistogramValue_IntValue struct {
	IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"`
}

type InfoValue

type InfoValue struct {

	// Optional.
	Info []*Label `protobuf:"bytes,1,rep,name=info,proto3" json:"info,omitempty"`
	// contains filtered or unexported fields
}

Value for INFO MetricPoint.

func (*InfoValue) Descriptor deprecated

func (*InfoValue) Descriptor() ([]byte, []int)

Deprecated: Use InfoValue.ProtoReflect.Descriptor instead.

func (*InfoValue) GetInfo

func (x *InfoValue) GetInfo() []*Label

func (*InfoValue) ProtoMessage

func (*InfoValue) ProtoMessage()

func (*InfoValue) ProtoReflect

func (x *InfoValue) ProtoReflect() protoreflect.Message

func (*InfoValue) Reset

func (x *InfoValue) Reset()

func (*InfoValue) String

func (x *InfoValue) String() string

type Label

type Label struct {

	// Required.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Required.
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

A name-value pair. These are used in multiple places: identifying timeseries, value of INFO metrics, and exemplars in Histograms.

func (*Label) Descriptor deprecated

func (*Label) Descriptor() ([]byte, []int)

Deprecated: Use Label.ProtoReflect.Descriptor instead.

func (*Label) GetName

func (x *Label) GetName() string

func (*Label) GetValue

func (x *Label) GetValue() string

func (*Label) ProtoMessage

func (*Label) ProtoMessage()

func (*Label) ProtoReflect

func (x *Label) ProtoReflect() protoreflect.Message

func (*Label) Reset

func (x *Label) Reset()

func (*Label) String

func (x *Label) String() string

type Metric

type Metric struct {

	// Optional.
	Labels []*Label `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"`
	// Optional.
	MetricPoints []*MetricPoint `protobuf:"bytes,2,rep,name=metric_points,json=metricPoints,proto3" json:"metric_points,omitempty"`
	// contains filtered or unexported fields
}

A single metric with a unique set of labels within a metric family.

func (*Metric) Descriptor deprecated

func (*Metric) Descriptor() ([]byte, []int)

Deprecated: Use Metric.ProtoReflect.Descriptor instead.

func (*Metric) GetLabels

func (x *Metric) GetLabels() []*Label

func (*Metric) GetMetricPoints

func (x *Metric) GetMetricPoints() []*MetricPoint

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) ProtoReflect

func (x *Metric) ProtoReflect() protoreflect.Message

func (*Metric) Reset

func (x *Metric) Reset()

func (*Metric) String

func (x *Metric) String() string

type MetricFamily

type MetricFamily struct {

	// Required.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Optional.
	Type MetricType `protobuf:"varint,2,opt,name=type,proto3,enum=openmetrics.MetricType" json:"type,omitempty"`
	// Optional.
	Unit string `protobuf:"bytes,3,opt,name=unit,proto3" json:"unit,omitempty"`
	// Optional.
	Help string `protobuf:"bytes,4,opt,name=help,proto3" json:"help,omitempty"`
	// Optional.
	Metrics []*Metric `protobuf:"bytes,5,rep,name=metrics,proto3" json:"metrics,omitempty"`
	// contains filtered or unexported fields
}

One or more Metrics for a single MetricFamily, where each Metric has one or more MetricPoints.

func TextToMetricFamilies

func TextToMetricFamilies(data []byte) ([]*MetricFamily, error)

func (*MetricFamily) Descriptor deprecated

func (*MetricFamily) Descriptor() ([]byte, []int)

Deprecated: Use MetricFamily.ProtoReflect.Descriptor instead.

func (*MetricFamily) GetHelp

func (x *MetricFamily) GetHelp() string

func (*MetricFamily) GetMetrics

func (x *MetricFamily) GetMetrics() []*Metric

func (*MetricFamily) GetName

func (x *MetricFamily) GetName() string

func (*MetricFamily) GetType

func (x *MetricFamily) GetType() MetricType

func (*MetricFamily) GetUnit

func (x *MetricFamily) GetUnit() string

func (*MetricFamily) ProtoMessage

func (*MetricFamily) ProtoMessage()

func (*MetricFamily) ProtoReflect

func (x *MetricFamily) ProtoReflect() protoreflect.Message

func (*MetricFamily) Reset

func (x *MetricFamily) Reset()

func (*MetricFamily) String

func (x *MetricFamily) String() string

type MetricPoint

type MetricPoint struct {

	// Required.
	//
	// Types that are assignable to Value:
	//
	//	*MetricPoint_UnknownValue
	//	*MetricPoint_GaugeValue
	//	*MetricPoint_CounterValue
	//	*MetricPoint_HistogramValue
	//	*MetricPoint_StateSetValue
	//	*MetricPoint_InfoValue
	//	*MetricPoint_SummaryValue
	Value isMetricPoint_Value `protobuf_oneof:"value"`
	// Optional.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

A MetricPoint in a Metric.

func (*MetricPoint) Descriptor deprecated

func (*MetricPoint) Descriptor() ([]byte, []int)

Deprecated: Use MetricPoint.ProtoReflect.Descriptor instead.

func (*MetricPoint) GetCounterValue

func (x *MetricPoint) GetCounterValue() *CounterValue

func (*MetricPoint) GetGaugeValue

func (x *MetricPoint) GetGaugeValue() *GaugeValue

func (*MetricPoint) GetHistogramValue

func (x *MetricPoint) GetHistogramValue() *HistogramValue

func (*MetricPoint) GetInfoValue

func (x *MetricPoint) GetInfoValue() *InfoValue

func (*MetricPoint) GetStateSetValue

func (x *MetricPoint) GetStateSetValue() *StateSetValue

func (*MetricPoint) GetSummaryValue

func (x *MetricPoint) GetSummaryValue() *SummaryValue

func (*MetricPoint) GetTimestamp

func (x *MetricPoint) GetTimestamp() *timestamppb.Timestamp

func (*MetricPoint) GetUnknownValue

func (x *MetricPoint) GetUnknownValue() *UnknownValue

func (*MetricPoint) GetValue

func (m *MetricPoint) GetValue() isMetricPoint_Value

func (*MetricPoint) ProtoMessage

func (*MetricPoint) ProtoMessage()

func (*MetricPoint) ProtoReflect

func (x *MetricPoint) ProtoReflect() protoreflect.Message

func (*MetricPoint) Reset

func (x *MetricPoint) Reset()

func (*MetricPoint) String

func (x *MetricPoint) String() string

type MetricPoint_CounterValue

type MetricPoint_CounterValue struct {
	CounterValue *CounterValue `protobuf:"bytes,3,opt,name=counter_value,json=counterValue,proto3,oneof"`
}

type MetricPoint_GaugeValue

type MetricPoint_GaugeValue struct {
	GaugeValue *GaugeValue `protobuf:"bytes,2,opt,name=gauge_value,json=gaugeValue,proto3,oneof"`
}

type MetricPoint_HistogramValue

type MetricPoint_HistogramValue struct {
	HistogramValue *HistogramValue `protobuf:"bytes,4,opt,name=histogram_value,json=histogramValue,proto3,oneof"`
}

type MetricPoint_InfoValue

type MetricPoint_InfoValue struct {
	InfoValue *InfoValue `protobuf:"bytes,6,opt,name=info_value,json=infoValue,proto3,oneof"`
}

type MetricPoint_StateSetValue

type MetricPoint_StateSetValue struct {
	StateSetValue *StateSetValue `protobuf:"bytes,5,opt,name=state_set_value,json=stateSetValue,proto3,oneof"`
}

type MetricPoint_SummaryValue

type MetricPoint_SummaryValue struct {
	SummaryValue *SummaryValue `protobuf:"bytes,7,opt,name=summary_value,json=summaryValue,proto3,oneof"`
}

type MetricPoint_UnknownValue

type MetricPoint_UnknownValue struct {
	UnknownValue *UnknownValue `protobuf:"bytes,1,opt,name=unknown_value,json=unknownValue,proto3,oneof"`
}

type MetricSet

type MetricSet struct {

	// Each MetricFamily has one or more MetricPoints for a single Metric.
	MetricFamilies []*MetricFamily `protobuf:"bytes,1,rep,name=metric_families,json=metricFamilies,proto3" json:"metric_families,omitempty"`
	// contains filtered or unexported fields
}

The top-level container type that is encoded and sent over the wire.

func (*MetricSet) Descriptor deprecated

func (*MetricSet) Descriptor() ([]byte, []int)

Deprecated: Use MetricSet.ProtoReflect.Descriptor instead.

func (*MetricSet) GetMetricFamilies

func (x *MetricSet) GetMetricFamilies() []*MetricFamily

func (*MetricSet) ProtoMessage

func (*MetricSet) ProtoMessage()

func (*MetricSet) ProtoReflect

func (x *MetricSet) ProtoReflect() protoreflect.Message

func (*MetricSet) Reset

func (x *MetricSet) Reset()

func (*MetricSet) String

func (x *MetricSet) String() string

type MetricType

type MetricType int32

The type of a Metric.

const (
	// Unknown must use unknown MetricPoint values.
	MetricType_UNKNOWN MetricType = 0
	// Gauge must use gauge MetricPoint values.
	MetricType_GAUGE MetricType = 1
	// Counter must use counter MetricPoint values.
	MetricType_COUNTER MetricType = 2
	// State set must use state set MetricPoint values.
	MetricType_STATE_SET MetricType = 3
	// Info must use info MetricPoint values.
	MetricType_INFO MetricType = 4
	// Histogram must use histogram value MetricPoint values.
	MetricType_HISTOGRAM MetricType = 5
	// Gauge histogram must use histogram value MetricPoint values.
	MetricType_GAUGE_HISTOGRAM MetricType = 6
	// Summary quantiles must use summary value MetricPoint values.
	MetricType_SUMMARY MetricType = 7
)

func (MetricType) Descriptor

func (MetricType) Descriptor() protoreflect.EnumDescriptor

func (MetricType) Enum

func (x MetricType) Enum() *MetricType

func (MetricType) EnumDescriptor deprecated

func (MetricType) EnumDescriptor() ([]byte, []int)

Deprecated: Use MetricType.Descriptor instead.

func (MetricType) Number

func (x MetricType) Number() protoreflect.EnumNumber

func (MetricType) String

func (x MetricType) String() string

func (MetricType) Type

type Parser

type Parser struct {
	IgnoreTimestamp bool              `toml:"openmetrics_ignore_timestamp"`
	MetricVersion   int               `toml:"openmetrics_metric_version"`
	Header          http.Header       `toml:"-"` // set by the input plugin
	DefaultTags     map[string]string `toml:"-"`
	Log             telegraf.Logger   `toml:"-"`
}

func (*Parser) Parse

func (p *Parser) Parse(data []byte) ([]telegraf.Metric, error)

func (*Parser) ParseLine

func (p *Parser) ParseLine(line string) (telegraf.Metric, error)

func (*Parser) SetDefaultTags

func (p *Parser) SetDefaultTags(tags map[string]string)

type StateSetValue

type StateSetValue struct {

	// Optional.
	States []*StateSetValue_State `protobuf:"bytes,1,rep,name=states,proto3" json:"states,omitempty"`
	// contains filtered or unexported fields
}

Value for STATE_SET MetricPoint.

func (*StateSetValue) Descriptor deprecated

func (*StateSetValue) Descriptor() ([]byte, []int)

Deprecated: Use StateSetValue.ProtoReflect.Descriptor instead.

func (*StateSetValue) GetStates

func (x *StateSetValue) GetStates() []*StateSetValue_State

func (*StateSetValue) ProtoMessage

func (*StateSetValue) ProtoMessage()

func (*StateSetValue) ProtoReflect

func (x *StateSetValue) ProtoReflect() protoreflect.Message

func (*StateSetValue) Reset

func (x *StateSetValue) Reset()

func (*StateSetValue) String

func (x *StateSetValue) String() string

type StateSetValue_State

type StateSetValue_State struct {

	// Required.
	Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"`
	// Required.
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*StateSetValue_State) Descriptor deprecated

func (*StateSetValue_State) Descriptor() ([]byte, []int)

Deprecated: Use StateSetValue_State.ProtoReflect.Descriptor instead.

func (*StateSetValue_State) GetEnabled

func (x *StateSetValue_State) GetEnabled() bool

func (*StateSetValue_State) GetName

func (x *StateSetValue_State) GetName() string

func (*StateSetValue_State) ProtoMessage

func (*StateSetValue_State) ProtoMessage()

func (*StateSetValue_State) ProtoReflect

func (x *StateSetValue_State) ProtoReflect() protoreflect.Message

func (*StateSetValue_State) Reset

func (x *StateSetValue_State) Reset()

func (*StateSetValue_State) String

func (x *StateSetValue_State) String() string

type SummaryValue

type SummaryValue struct {

	// Optional.
	//
	// Types that are assignable to Sum:
	//
	//	*SummaryValue_DoubleValue
	//	*SummaryValue_IntValue
	Sum isSummaryValue_Sum `protobuf_oneof:"sum"`
	// Optional.
	Count uint64 `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`
	// The time sum and count values began being collected for this summary.
	// Optional.
	Created *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=created,proto3" json:"created,omitempty"`
	// Optional.
	Quantile []*SummaryValue_Quantile `protobuf:"bytes,5,rep,name=quantile,proto3" json:"quantile,omitempty"`
	// contains filtered or unexported fields
}

Value for SUMMARY MetricPoint.

func (*SummaryValue) Descriptor deprecated

func (*SummaryValue) Descriptor() ([]byte, []int)

Deprecated: Use SummaryValue.ProtoReflect.Descriptor instead.

func (*SummaryValue) GetCount

func (x *SummaryValue) GetCount() uint64

func (*SummaryValue) GetCreated

func (x *SummaryValue) GetCreated() *timestamppb.Timestamp

func (*SummaryValue) GetDoubleValue

func (x *SummaryValue) GetDoubleValue() float64

func (*SummaryValue) GetIntValue

func (x *SummaryValue) GetIntValue() int64

func (*SummaryValue) GetQuantile

func (x *SummaryValue) GetQuantile() []*SummaryValue_Quantile

func (*SummaryValue) GetSum

func (m *SummaryValue) GetSum() isSummaryValue_Sum

func (*SummaryValue) ProtoMessage

func (*SummaryValue) ProtoMessage()

func (*SummaryValue) ProtoReflect

func (x *SummaryValue) ProtoReflect() protoreflect.Message

func (*SummaryValue) Reset

func (x *SummaryValue) Reset()

func (*SummaryValue) String

func (x *SummaryValue) String() string

type SummaryValue_DoubleValue

type SummaryValue_DoubleValue struct {
	DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"`
}

type SummaryValue_IntValue

type SummaryValue_IntValue struct {
	IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"`
}

type SummaryValue_Quantile

type SummaryValue_Quantile struct {

	// Required.
	Quantile float64 `protobuf:"fixed64,1,opt,name=quantile,proto3" json:"quantile,omitempty"`
	// Required.
	Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*SummaryValue_Quantile) Descriptor deprecated

func (*SummaryValue_Quantile) Descriptor() ([]byte, []int)

Deprecated: Use SummaryValue_Quantile.ProtoReflect.Descriptor instead.

func (*SummaryValue_Quantile) GetQuantile

func (x *SummaryValue_Quantile) GetQuantile() float64

func (*SummaryValue_Quantile) GetValue

func (x *SummaryValue_Quantile) GetValue() float64

func (*SummaryValue_Quantile) ProtoMessage

func (*SummaryValue_Quantile) ProtoMessage()

func (*SummaryValue_Quantile) ProtoReflect

func (x *SummaryValue_Quantile) ProtoReflect() protoreflect.Message

func (*SummaryValue_Quantile) Reset

func (x *SummaryValue_Quantile) Reset()

func (*SummaryValue_Quantile) String

func (x *SummaryValue_Quantile) String() string

type UnknownValue

type UnknownValue struct {

	// Required.
	//
	// Types that are assignable to Value:
	//
	//	*UnknownValue_DoubleValue
	//	*UnknownValue_IntValue
	Value isUnknownValue_Value `protobuf_oneof:"value"`
	// contains filtered or unexported fields
}

Value for UNKNOWN MetricPoint.

func (*UnknownValue) Descriptor deprecated

func (*UnknownValue) Descriptor() ([]byte, []int)

Deprecated: Use UnknownValue.ProtoReflect.Descriptor instead.

func (*UnknownValue) GetDoubleValue

func (x *UnknownValue) GetDoubleValue() float64

func (*UnknownValue) GetIntValue

func (x *UnknownValue) GetIntValue() int64

func (*UnknownValue) GetValue

func (m *UnknownValue) GetValue() isUnknownValue_Value

func (*UnknownValue) ProtoMessage

func (*UnknownValue) ProtoMessage()

func (*UnknownValue) ProtoReflect

func (x *UnknownValue) ProtoReflect() protoreflect.Message

func (*UnknownValue) Reset

func (x *UnknownValue) Reset()

func (*UnknownValue) String

func (x *UnknownValue) String() string

type UnknownValue_DoubleValue

type UnknownValue_DoubleValue struct {
	DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof"`
}

type UnknownValue_IntValue

type UnknownValue_IntValue struct {
	IntValue int64 `protobuf:"varint,2,opt,name=int_value,json=intValue,proto3,oneof"`
}

Jump to

Keyboard shortcuts

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