writev2

package
v0.0.0-...-c316de0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2025 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Metadata_MetricType_name = map[int32]string{
		0: "METRIC_TYPE_UNSPECIFIED",
		1: "METRIC_TYPE_COUNTER",
		2: "METRIC_TYPE_GAUGE",
		3: "METRIC_TYPE_HISTOGRAM",
		4: "METRIC_TYPE_GAUGEHISTOGRAM",
		5: "METRIC_TYPE_SUMMARY",
		6: "METRIC_TYPE_INFO",
		7: "METRIC_TYPE_STATESET",
	}
	Metadata_MetricType_value = map[string]int32{
		"METRIC_TYPE_UNSPECIFIED":    0,
		"METRIC_TYPE_COUNTER":        1,
		"METRIC_TYPE_GAUGE":          2,
		"METRIC_TYPE_HISTOGRAM":      3,
		"METRIC_TYPE_GAUGEHISTOGRAM": 4,
		"METRIC_TYPE_SUMMARY":        5,
		"METRIC_TYPE_INFO":           6,
		"METRIC_TYPE_STATESET":       7,
	}
)

Enum value maps for Metadata_MetricType.

View Source
var (
	Histogram_ResetHint_name = map[int32]string{
		0: "RESET_HINT_UNSPECIFIED",
		1: "RESET_HINT_YES",
		2: "RESET_HINT_NO",
		3: "RESET_HINT_GAUGE",
	}
	Histogram_ResetHint_value = map[string]int32{
		"RESET_HINT_UNSPECIFIED": 0,
		"RESET_HINT_YES":         1,
		"RESET_HINT_NO":          2,
		"RESET_HINT_GAUGE":       3,
	}
)

Enum value maps for Histogram_ResetHint.

View Source
var File_io_prometheus_write_v2_types_proto protoreflect.FileDescriptor

Functions

func DesymbolizeLabels

func DesymbolizeLabels(labelRefs []uint32, symbols, buf []string) []string

DesymbolizeLabels decodes label references, with given symbols to labels.

Types

type BucketSpan

type BucketSpan struct {
	Offset int32  `protobuf:"zigzag32,1,opt,name=offset,proto3" json:"offset,omitempty"` // Gap to previous span, or starting point for 1st span (which can be negative).
	Length uint32 `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"`   // Length of consecutive buckets.
	// contains filtered or unexported fields
}

A BucketSpan defines a number of consecutive buckets with their offset. Logically, it would be more straightforward to include the bucket counts in the Span. However, the protobuf representation is more compact in the way the data is structured here (with all the buckets in a single array separate from the Spans).

func (*BucketSpan) Descriptor deprecated

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

Deprecated: Use BucketSpan.ProtoReflect.Descriptor instead.

func (*BucketSpan) GetLength

func (x *BucketSpan) GetLength() uint32

func (*BucketSpan) GetOffset

func (x *BucketSpan) GetOffset() int32

func (*BucketSpan) MarshalToSizedBufferVT

func (m *BucketSpan) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*BucketSpan) MarshalToVT

func (m *BucketSpan) MarshalToVT(dAtA []byte) (int, error)

func (*BucketSpan) MarshalVT

func (m *BucketSpan) MarshalVT() (dAtA []byte, err error)

func (*BucketSpan) ProtoMessage

func (*BucketSpan) ProtoMessage()

func (*BucketSpan) ProtoReflect

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

func (*BucketSpan) Reset

func (x *BucketSpan) Reset()

func (*BucketSpan) SizeVT

func (m *BucketSpan) SizeVT() (n int)

func (*BucketSpan) String

func (x *BucketSpan) String() string

func (*BucketSpan) UnmarshalVT

func (m *BucketSpan) UnmarshalVT(dAtA []byte) error

type Exemplar

type Exemplar struct {

	// labels_refs is an optional list of label name-value pair references, encoded
	// as indices to the Request.symbols array. This list's len is always
	// a multiple of 2, and the underlying labels should be sorted lexicographically.
	// If the exemplar references a trace it should use the `trace_id` label name, as a best practice.
	LabelsRefs []uint32 `protobuf:"varint,1,rep,packed,name=labels_refs,json=labelsRefs,proto3" json:"labels_refs,omitempty"`
	// value represents an exact example value. This can be useful when the exemplar
	// is attached to a histogram, which only gives an estimated value through buckets.
	Value float64 `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
	// timestamp represents the timestamp of the exemplar in ms.
	//
	// For Go, see github.com/prometheus/prometheus/model/timestamp/timestamp.go
	// for conversion from/to time.Time to Prometheus timestamp.
	Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

Exemplar is an additional information attached to some series' samples. It is typically used to attach an example trace or request ID associated with the metric changes.

func (*Exemplar) Descriptor deprecated

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

Deprecated: Use Exemplar.ProtoReflect.Descriptor instead.

func (*Exemplar) GetLabelsRefs

func (x *Exemplar) GetLabelsRefs() []uint32

func (*Exemplar) GetTimestamp

func (x *Exemplar) GetTimestamp() int64

func (*Exemplar) GetValue

func (x *Exemplar) GetValue() float64

func (*Exemplar) MarshalToSizedBufferVT

func (m *Exemplar) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Exemplar) MarshalToVT

func (m *Exemplar) MarshalToVT(dAtA []byte) (int, error)

func (*Exemplar) MarshalVT

func (m *Exemplar) MarshalVT() (dAtA []byte, err error)

func (*Exemplar) ProtoMessage

func (*Exemplar) ProtoMessage()

func (*Exemplar) ProtoReflect

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

func (*Exemplar) Reset

func (x *Exemplar) Reset()

func (*Exemplar) SizeVT

func (m *Exemplar) SizeVT() (n int)

func (*Exemplar) String

func (x *Exemplar) String() string

func (*Exemplar) UnmarshalVT

func (m *Exemplar) UnmarshalVT(dAtA []byte) error

type Histogram

type Histogram struct {

	// Types that are assignable to Count:
	//
	//	*Histogram_CountInt
	//	*Histogram_CountFloat
	Count isHistogram_Count `protobuf_oneof:"count"`
	Sum   float64           `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"` // Sum of observations in the histogram.
	// The schema defines the bucket schema. Currently, valid numbers
	// are -53 and numbers in range of -4 <= n <= 8. More valid numbers might be
	// added in future for new bucketing layouts.
	//
	// The schema equal to -53 means custom buckets. See
	// custom_values field description for more details.
	//
	// Values between -4 and 8 represent base-2 bucket schema, where 1
	// is a bucket boundary in each case, and then each power of two is
	// divided into 2^n (n is schema value) logarithmic buckets. Or in other words,
	// each bucket boundary is the previous boundary times 2^(2^-n).
	Schema        int32   `protobuf:"zigzag32,4,opt,name=schema,proto3" json:"schema,omitempty"`
	ZeroThreshold float64 `protobuf:"fixed64,5,opt,name=zero_threshold,json=zeroThreshold,proto3" json:"zero_threshold,omitempty"` // Breadth of the zero bucket.
	// Types that are assignable to ZeroCount:
	//
	//	*Histogram_ZeroCountInt
	//	*Histogram_ZeroCountFloat
	ZeroCount isHistogram_ZeroCount `protobuf_oneof:"zero_count"`
	// Negative Buckets.
	NegativeSpans []*BucketSpan `protobuf:"bytes,8,rep,name=negative_spans,json=negativeSpans,proto3" json:"negative_spans,omitempty"`
	// Use either "negative_deltas" or "negative_counts", the former for
	// regular histograms with integer counts, the latter for
	// float histograms.
	NegativeDeltas []int64   `protobuf:"zigzag64,9,rep,packed,name=negative_deltas,json=negativeDeltas,proto3" json:"negative_deltas,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket).
	NegativeCounts []float64 `protobuf:"fixed64,10,rep,packed,name=negative_counts,json=negativeCounts,proto3" json:"negative_counts,omitempty"` // Absolute count of each bucket.
	// Positive Buckets.
	//
	// In case of custom buckets (-53 schema value) the positive buckets are interpreted as follows:
	// * The span offset+length points to an the index of the custom_values array
	// or +Inf if pointing to the len of the array.
	// * The counts and deltas have the same meaning as for exponential histograms.
	PositiveSpans []*BucketSpan `protobuf:"bytes,11,rep,name=positive_spans,json=positiveSpans,proto3" json:"positive_spans,omitempty"`
	// Use either "positive_deltas" or "positive_counts", the former for
	// regular histograms with integer counts, the latter for
	// float histograms.
	PositiveDeltas []int64             `protobuf:"zigzag64,12,rep,packed,name=positive_deltas,json=positiveDeltas,proto3" json:"positive_deltas,omitempty"` // Count delta of each bucket compared to previous one (or to zero for 1st bucket).
	PositiveCounts []float64           `protobuf:"fixed64,13,rep,packed,name=positive_counts,json=positiveCounts,proto3" json:"positive_counts,omitempty"`  // Absolute count of each bucket.
	ResetHint      Histogram_ResetHint ``                                                                                                                   /* 138-byte string literal not displayed */
	// timestamp represents timestamp of the sample in ms.
	//
	// For Go, see github.com/prometheus/prometheus/model/timestamp/timestamp.go
	// for conversion from/to time.Time to Prometheus timestamp.
	Timestamp int64 `protobuf:"varint,15,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// custom_values is an additional field used by non-exponential bucketing layouts.
	//
	// For custom buckets (-53 schema value) custom_values specify monotonically
	// increasing upper inclusive boundaries for the bucket counts with arbitrary
	// widths for this histogram. In other words, custom_values represents custom,
	// explicit bucketing that could have been converted from the classic histograms.
	//
	// Those bounds are then referenced by spans in positive_spans with corresponding positive
	// counts of deltas (refer to positive_spans for more details). This way we can
	// have encode sparse histograms with custom bucketing (many buckets are often
	// not used).
	//
	// Note that for custom bounds, even negative observations are placed in the positive
	// counts to simplify the implementation and avoid ambiguity of where to place
	// an underflow bucket, e.g. (-2, 1]. Therefore negative buckets and
	// the zero bucket are unused, if the schema indicates custom bucketing.
	//
	// For each upper boundary the previous boundary represent the lower exclusive
	// boundary for that bucket. The first element is the upper inclusive boundary
	// for the first bucket, which implicitly has a lower inclusive bound of -Inf.
	// This is similar to "le" label semantics on classic histograms. You may add a
	// bucket with an upper bound of 0 to make sure that you really have no negative
	// observations, but in practice, native histogram rendering will show both with
	// or without first upper boundary 0 and no negative counts as the same case.
	//
	// The last element is not only the upper inclusive bound of the last regular
	// bucket, but implicitly the lower exclusive bound of the +Inf bucket.
	CustomValues []float64 `protobuf:"fixed64,16,rep,packed,name=custom_values,json=customValues,proto3" json:"custom_values,omitempty"`
	// contains filtered or unexported fields
}

A native histogram, also known as a sparse histogram. Original design doc: https://docs.google.com/document/d/1cLNv3aufPZb3fNfaJgdaRBZsInZKKIHo9E6HinJVbpM/edit The appendix of this design doc also explains the concept of float histograms. This Histogram message can represent both, the usual integer histogram as well as a float histogram.

func (*Histogram) Descriptor deprecated

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

Deprecated: Use Histogram.ProtoReflect.Descriptor instead.

func (*Histogram) GetCount

func (m *Histogram) GetCount() isHistogram_Count

func (*Histogram) GetCountFloat

func (x *Histogram) GetCountFloat() float64

func (*Histogram) GetCountInt

func (x *Histogram) GetCountInt() uint64

func (*Histogram) GetCustomValues

func (x *Histogram) GetCustomValues() []float64

func (*Histogram) GetNegativeCounts

func (x *Histogram) GetNegativeCounts() []float64

func (*Histogram) GetNegativeDeltas

func (x *Histogram) GetNegativeDeltas() []int64

func (*Histogram) GetNegativeSpans

func (x *Histogram) GetNegativeSpans() []*BucketSpan

func (*Histogram) GetPositiveCounts

func (x *Histogram) GetPositiveCounts() []float64

func (*Histogram) GetPositiveDeltas

func (x *Histogram) GetPositiveDeltas() []int64

func (*Histogram) GetPositiveSpans

func (x *Histogram) GetPositiveSpans() []*BucketSpan

func (*Histogram) GetResetHint

func (x *Histogram) GetResetHint() Histogram_ResetHint

func (*Histogram) GetSchema

func (x *Histogram) GetSchema() int32

func (*Histogram) GetSum

func (x *Histogram) GetSum() float64

func (*Histogram) GetTimestamp

func (x *Histogram) GetTimestamp() int64

func (*Histogram) GetZeroCount

func (m *Histogram) GetZeroCount() isHistogram_ZeroCount

func (*Histogram) GetZeroCountFloat

func (x *Histogram) GetZeroCountFloat() float64

func (*Histogram) GetZeroCountInt

func (x *Histogram) GetZeroCountInt() uint64

func (*Histogram) GetZeroThreshold

func (x *Histogram) GetZeroThreshold() float64

func (*Histogram) MarshalToSizedBufferVT

func (m *Histogram) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Histogram) MarshalToVT

func (m *Histogram) MarshalToVT(dAtA []byte) (int, error)

func (*Histogram) MarshalVT

func (m *Histogram) MarshalVT() (dAtA []byte, err error)

func (*Histogram) ProtoMessage

func (*Histogram) ProtoMessage()

func (*Histogram) ProtoReflect

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

func (*Histogram) Reset

func (x *Histogram) Reset()

func (*Histogram) SizeVT

func (m *Histogram) SizeVT() (n int)

func (*Histogram) String

func (x *Histogram) String() string

func (*Histogram) UnmarshalVT

func (m *Histogram) UnmarshalVT(dAtA []byte) error

type Histogram_CountFloat

type Histogram_CountFloat struct {
	CountFloat float64 `protobuf:"fixed64,2,opt,name=count_float,json=countFloat,proto3,oneof"`
}

func (*Histogram_CountFloat) MarshalToSizedBufferVT

func (m *Histogram_CountFloat) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Histogram_CountFloat) MarshalToVT

func (m *Histogram_CountFloat) MarshalToVT(dAtA []byte) (int, error)

func (*Histogram_CountFloat) SizeVT

func (m *Histogram_CountFloat) SizeVT() (n int)

type Histogram_CountInt

type Histogram_CountInt struct {
	CountInt uint64 `protobuf:"varint,1,opt,name=count_int,json=countInt,proto3,oneof"`
}

func (*Histogram_CountInt) MarshalToSizedBufferVT

func (m *Histogram_CountInt) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Histogram_CountInt) MarshalToVT

func (m *Histogram_CountInt) MarshalToVT(dAtA []byte) (int, error)

func (*Histogram_CountInt) SizeVT

func (m *Histogram_CountInt) SizeVT() (n int)

type Histogram_ResetHint

type Histogram_ResetHint int32
const (
	Histogram_RESET_HINT_UNSPECIFIED Histogram_ResetHint = 0 // Need to test for a counter reset explicitly.
	Histogram_RESET_HINT_YES         Histogram_ResetHint = 1 // This is the 1st histogram after a counter reset.
	Histogram_RESET_HINT_NO          Histogram_ResetHint = 2 // There was no counter reset between this and the previous Histogram.
	Histogram_RESET_HINT_GAUGE       Histogram_ResetHint = 3 // This is a gauge histogram where counter resets don't happen.
)

func (Histogram_ResetHint) Descriptor

func (Histogram_ResetHint) Enum

func (Histogram_ResetHint) EnumDescriptor deprecated

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

Deprecated: Use Histogram_ResetHint.Descriptor instead.

func (Histogram_ResetHint) Number

func (Histogram_ResetHint) String

func (x Histogram_ResetHint) String() string

func (Histogram_ResetHint) Type

type Histogram_ZeroCountFloat

type Histogram_ZeroCountFloat struct {
	ZeroCountFloat float64 `protobuf:"fixed64,7,opt,name=zero_count_float,json=zeroCountFloat,proto3,oneof"`
}

func (*Histogram_ZeroCountFloat) MarshalToSizedBufferVT

func (m *Histogram_ZeroCountFloat) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Histogram_ZeroCountFloat) MarshalToVT

func (m *Histogram_ZeroCountFloat) MarshalToVT(dAtA []byte) (int, error)

func (*Histogram_ZeroCountFloat) SizeVT

func (m *Histogram_ZeroCountFloat) SizeVT() (n int)

type Histogram_ZeroCountInt

type Histogram_ZeroCountInt struct {
	ZeroCountInt uint64 `protobuf:"varint,6,opt,name=zero_count_int,json=zeroCountInt,proto3,oneof"`
}

func (*Histogram_ZeroCountInt) MarshalToSizedBufferVT

func (m *Histogram_ZeroCountInt) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Histogram_ZeroCountInt) MarshalToVT

func (m *Histogram_ZeroCountInt) MarshalToVT(dAtA []byte) (int, error)

func (*Histogram_ZeroCountInt) SizeVT

func (m *Histogram_ZeroCountInt) SizeVT() (n int)

type Metadata

type Metadata struct {
	Type Metadata_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=io.prometheus.write.v2.Metadata_MetricType" json:"type,omitempty"`
	// help_ref is a reference to the Request.symbols array representing help
	// text for the metric. Help is optional, reference should point to an empty string in
	// such a case.
	HelpRef uint32 `protobuf:"varint,3,opt,name=help_ref,json=helpRef,proto3" json:"help_ref,omitempty"`
	// unit_ref is a reference to the Request.symbols array representing a unit
	// for the metric. Unit is optional, reference should point to an empty string in
	// such a case.
	UnitRef uint32 `protobuf:"varint,4,opt,name=unit_ref,json=unitRef,proto3" json:"unit_ref,omitempty"`
	// contains filtered or unexported fields
}

Metadata represents the metadata associated with the given series' samples.

func (*Metadata) Descriptor deprecated

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

Deprecated: Use Metadata.ProtoReflect.Descriptor instead.

func (*Metadata) GetHelpRef

func (x *Metadata) GetHelpRef() uint32

func (*Metadata) GetType

func (x *Metadata) GetType() Metadata_MetricType

func (*Metadata) GetUnitRef

func (x *Metadata) GetUnitRef() uint32

func (*Metadata) MarshalToSizedBufferVT

func (m *Metadata) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Metadata) MarshalToVT

func (m *Metadata) MarshalToVT(dAtA []byte) (int, error)

func (*Metadata) MarshalVT

func (m *Metadata) MarshalVT() (dAtA []byte, err error)

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) ProtoReflect

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

func (*Metadata) Reset

func (x *Metadata) Reset()

func (*Metadata) SizeVT

func (m *Metadata) SizeVT() (n int)

func (*Metadata) String

func (x *Metadata) String() string

func (*Metadata) UnmarshalVT

func (m *Metadata) UnmarshalVT(dAtA []byte) error

type Metadata_MetricType

type Metadata_MetricType int32
const (
	Metadata_METRIC_TYPE_UNSPECIFIED    Metadata_MetricType = 0
	Metadata_METRIC_TYPE_COUNTER        Metadata_MetricType = 1
	Metadata_METRIC_TYPE_GAUGE          Metadata_MetricType = 2
	Metadata_METRIC_TYPE_HISTOGRAM      Metadata_MetricType = 3
	Metadata_METRIC_TYPE_GAUGEHISTOGRAM Metadata_MetricType = 4
	Metadata_METRIC_TYPE_SUMMARY        Metadata_MetricType = 5
	Metadata_METRIC_TYPE_INFO           Metadata_MetricType = 6
	Metadata_METRIC_TYPE_STATESET       Metadata_MetricType = 7
)

func (Metadata_MetricType) Descriptor

func (Metadata_MetricType) Enum

func (Metadata_MetricType) EnumDescriptor deprecated

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

Deprecated: Use Metadata_MetricType.Descriptor instead.

func (Metadata_MetricType) Number

func (Metadata_MetricType) String

func (x Metadata_MetricType) String() string

func (Metadata_MetricType) Type

type Request

type Request struct {

	// symbols contains a de-duplicated array of string elements used for various
	// items in a Request message, like labels and metadata items. For the sender's convenience
	// around empty values for optional fields like unit_ref, symbols array MUST start with
	// empty string.
	//
	// To decode each of the symbolized strings, referenced, by "ref(s)" suffix, you
	// need to lookup the actual string by index from symbols array. The order of
	// strings is up to the sender. The receiver should not assume any particular encoding.
	Symbols []string `protobuf:"bytes,4,rep,name=symbols,proto3" json:"symbols,omitempty"`
	// timeseries represents an array of distinct series with 0 or more samples.
	Timeseries []*TimeSeries `protobuf:"bytes,5,rep,name=timeseries,proto3" json:"timeseries,omitempty"`
	// contains filtered or unexported fields
}

Request represents a request to write the given timeseries to a remote destination. This message was introduced in the Remote Write 2.0 specification: https://prometheus.io/docs/concepts/remote_write_spec_2_0/

The canonical Content-Type request header value for this message is "application/x-protobuf;proto=io.prometheus.write.v2.Request"

NOTE: gogoproto options might change in future for this file, they are not part of the spec proto (they only modify the generated Go code, not the serialized message). See: https://github.com/prometheus/prometheus/issues/11908

func (*Request) Descriptor deprecated

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

func (*Request) GetSymbols

func (x *Request) GetSymbols() []string

func (*Request) GetTimeseries

func (x *Request) GetTimeseries() []*TimeSeries

func (*Request) MarshalToSizedBufferVT

func (m *Request) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Request) MarshalToVT

func (m *Request) MarshalToVT(dAtA []byte) (int, error)

func (*Request) MarshalVT

func (m *Request) MarshalVT() (dAtA []byte, err error)

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) SizeVT

func (m *Request) SizeVT() (n int)

func (*Request) String

func (x *Request) String() string

func (*Request) UnmarshalVT

func (m *Request) UnmarshalVT(dAtA []byte) error

type Sample

type Sample struct {

	// value of the sample.
	Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	// timestamp represents timestamp of the sample in ms.
	//
	// For Go, see github.com/prometheus/prometheus/model/timestamp/timestamp.go
	// for conversion from/to time.Time to Prometheus timestamp.
	Timestamp int64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// contains filtered or unexported fields
}

Sample represents series sample.

func (*Sample) Descriptor deprecated

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

Deprecated: Use Sample.ProtoReflect.Descriptor instead.

func (*Sample) GetTimestamp

func (x *Sample) GetTimestamp() int64

func (*Sample) GetValue

func (x *Sample) GetValue() float64

func (*Sample) MarshalToSizedBufferVT

func (m *Sample) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Sample) MarshalToVT

func (m *Sample) MarshalToVT(dAtA []byte) (int, error)

func (*Sample) MarshalVT

func (m *Sample) MarshalVT() (dAtA []byte, err error)

func (*Sample) ProtoMessage

func (*Sample) ProtoMessage()

func (*Sample) ProtoReflect

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

func (*Sample) Reset

func (x *Sample) Reset()

func (*Sample) SizeVT

func (m *Sample) SizeVT() (n int)

func (*Sample) String

func (x *Sample) String() string

func (*Sample) UnmarshalVT

func (m *Sample) UnmarshalVT(dAtA []byte) error

type SymbolsTable

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

SymbolsTable implements table for easy symbol use.

func NewSymbolTable

func NewSymbolTable() SymbolsTable

NewSymbolTable returns a symbol table.

func (*SymbolsTable) Reset

func (t *SymbolsTable) Reset()

Reset clears symbols table.

func (*SymbolsTable) Symbolize

func (t *SymbolsTable) Symbolize(str string) uint32

Symbolize adds (if not added before) a string to the symbols table, while returning its reference number.

func (*SymbolsTable) SymbolizeLabels

func (t *SymbolsTable) SymbolizeLabels(lbls []string, buf []uint32) []uint32

SymbolizeLabels symbolize Prometheus labels.

func (*SymbolsTable) Symbols

func (t *SymbolsTable) Symbols() []string

Symbols returns computes symbols table to put in e.g. Request.Symbols. As per spec, order does not matter.

type TimeSeries

type TimeSeries struct {

	// labels_refs is a list of label name-value pair references, encoded
	// as indices to the Request.symbols array. This list's length is always
	// a multiple of two, and the underlying labels should be sorted lexicographically.
	//
	// Note that there might be multiple TimeSeries objects in the same
	// Requests with the same labels e.g. for different exemplars, metadata
	// or created timestamp.
	LabelsRefs []uint32 `protobuf:"varint,1,rep,packed,name=labels_refs,json=labelsRefs,proto3" json:"labels_refs,omitempty"`
	// Timeseries messages can either specify samples or (native) histogram samples
	// (histogram field), but not both. For a typical sender (real-time metric
	// streaming), in healthy cases, there will be only one sample or histogram.
	//
	// Samples and histograms are sorted by timestamp (older first).
	Samples    []*Sample    `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples,omitempty"`
	Histograms []*Histogram `protobuf:"bytes,3,rep,name=histograms,proto3" json:"histograms,omitempty"`
	// exemplars represents an optional set of exemplars attached to this series' samples.
	Exemplars []*Exemplar `protobuf:"bytes,4,rep,name=exemplars,proto3" json:"exemplars,omitempty"`
	// metadata represents the metadata associated with the given series' samples.
	Metadata *Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// created_timestamp represents an optional created timestamp associated with
	// this series' samples in ms format, typically for counter or histogram type
	// metrics. Created timestamp represents the time when the counter started
	// counting (sometimes referred to as start timestamp), which can increase
	// the accuracy of query results.
	//
	// Note that some receivers might require this and in return fail to
	// ingest such samples within the Request.
	//
	// For Go, see github.com/prometheus/prometheus/model/timestamp/timestamp.go
	// for conversion from/to time.Time to Prometheus timestamp.
	//
	// Note that the "optional" keyword is omitted due to
	// https://cloud.google.com/apis/design/design_patterns.md#optional_primitive_fields
	// Zero value means value not set. If you need to use exactly zero value for
	// the timestamp, use 1 millisecond before or after.
	CreatedTimestamp int64 `protobuf:"varint,6,opt,name=created_timestamp,json=createdTimestamp,proto3" json:"created_timestamp,omitempty"`
	// contains filtered or unexported fields
}

TimeSeries represents a single series.

func (*TimeSeries) Descriptor deprecated

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

Deprecated: Use TimeSeries.ProtoReflect.Descriptor instead.

func (*TimeSeries) GetCreatedTimestamp

func (x *TimeSeries) GetCreatedTimestamp() int64

func (*TimeSeries) GetExemplars

func (x *TimeSeries) GetExemplars() []*Exemplar

func (*TimeSeries) GetHistograms

func (x *TimeSeries) GetHistograms() []*Histogram

func (*TimeSeries) GetLabelsRefs

func (x *TimeSeries) GetLabelsRefs() []uint32

func (*TimeSeries) GetMetadata

func (x *TimeSeries) GetMetadata() *Metadata

func (*TimeSeries) GetSamples

func (x *TimeSeries) GetSamples() []*Sample

func (*TimeSeries) MarshalToSizedBufferVT

func (m *TimeSeries) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TimeSeries) MarshalToVT

func (m *TimeSeries) MarshalToVT(dAtA []byte) (int, error)

func (*TimeSeries) MarshalVT

func (m *TimeSeries) MarshalVT() (dAtA []byte, err error)

func (*TimeSeries) ProtoMessage

func (*TimeSeries) ProtoMessage()

func (*TimeSeries) ProtoReflect

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

func (*TimeSeries) Reset

func (x *TimeSeries) Reset()

func (*TimeSeries) SizeVT

func (m *TimeSeries) SizeVT() (n int)

func (*TimeSeries) String

func (x *TimeSeries) String() string

func (*TimeSeries) UnmarshalVT

func (m *TimeSeries) UnmarshalVT(dAtA []byte) error

Jump to

Keyboard shortcuts

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