writev2

package
v0.304.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2025 License: Apache-2.0 Imports: 13 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
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",
}
View Source
var Histogram_ResetHint_value = map[string]int32{
	"RESET_HINT_UNSPECIFIED": 0,
	"RESET_HINT_YES":         1,
	"RESET_HINT_NO":          2,
	"RESET_HINT_GAUGE":       3,
}
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",
}
View Source
var 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,
}

Functions

This section is empty.

Types

type BucketSpan

type BucketSpan struct {
	Offset               int32    `protobuf:"zigzag32,1,opt,name=offset,proto3" json:"offset,omitempty"`
	Length               uint32   `protobuf:"varint,2,opt,name=length,proto3" json:"length,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

func (*BucketSpan) GetLength

func (m *BucketSpan) GetLength() uint32

func (*BucketSpan) GetOffset

func (m *BucketSpan) GetOffset() int32

func (*BucketSpan) Marshal

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

func (*BucketSpan) MarshalTo

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

func (*BucketSpan) MarshalToSizedBuffer

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

func (*BucketSpan) ProtoMessage

func (*BucketSpan) ProtoMessage()

func (*BucketSpan) Reset

func (m *BucketSpan) Reset()

func (*BucketSpan) Size

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

func (*BucketSpan) String

func (m *BucketSpan) String() string

func (*BucketSpan) Unmarshal

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

func (*BucketSpan) XXX_DiscardUnknown

func (m *BucketSpan) XXX_DiscardUnknown()

func (*BucketSpan) XXX_Marshal

func (m *BucketSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BucketSpan) XXX_Merge

func (m *BucketSpan) XXX_Merge(src proto.Message)

func (*BucketSpan) XXX_Size

func (m *BucketSpan) XXX_Size() int

func (*BucketSpan) XXX_Unmarshal

func (m *BucketSpan) XXX_Unmarshal(b []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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

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

func (*Exemplar) GetLabelsRefs

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

func (*Exemplar) GetTimestamp

func (m *Exemplar) GetTimestamp() int64

func (*Exemplar) GetValue

func (m *Exemplar) GetValue() float64

func (*Exemplar) Marshal

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

func (*Exemplar) MarshalTo

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

func (*Exemplar) MarshalToSizedBuffer

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

func (*Exemplar) ProtoMessage

func (*Exemplar) ProtoMessage()

func (*Exemplar) Reset

func (m *Exemplar) Reset()

func (*Exemplar) Size

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

func (*Exemplar) String

func (m *Exemplar) String() string

func (Exemplar) ToExemplar

func (m Exemplar) ToExemplar(b *labels.ScratchBuilder, symbols []string) exemplar.Exemplar

func (*Exemplar) Unmarshal

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

func (*Exemplar) XXX_DiscardUnknown

func (m *Exemplar) XXX_DiscardUnknown()

func (*Exemplar) XXX_Marshal

func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Exemplar) XXX_Merge

func (m *Exemplar) XXX_Merge(src proto.Message)

func (*Exemplar) XXX_Size

func (m *Exemplar) XXX_Size() int

func (*Exemplar) XXX_Unmarshal

func (m *Exemplar) XXX_Unmarshal(b []byte) error

type Histogram

type Histogram struct {
	// Types that are valid to be assigned to Count:
	//
	//	*Histogram_CountInt
	//	*Histogram_CountFloat
	Count isHistogram_Count `protobuf_oneof:"count"`
	Sum   float64           `protobuf:"fixed64,3,opt,name=sum,proto3" json:"sum,omitempty"`
	// 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"`
	// Types that are valid to be assigned 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"`
	// 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"`
	NegativeCounts []float64 `protobuf:"fixed64,10,rep,packed,name=negative_counts,json=negativeCounts,proto3" json:"negative_counts,omitempty"`
	// 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"`
	// 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"`
	PositiveCounts []float64           `protobuf:"fixed64,13,rep,packed,name=positive_counts,json=positiveCounts,proto3" json:"positive_counts,omitempty"`
	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"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

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 FromFloatHistogram

func FromFloatHistogram(timestamp int64, fh *histogram.FloatHistogram) Histogram

FromFloatHistogram returns remote Histogram from the float Histogram.

func FromIntHistogram

func FromIntHistogram(timestamp int64, h *histogram.Histogram) Histogram

FromIntHistogram returns remote Histogram from the integer Histogram.

func (*Histogram) Descriptor

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

func (*Histogram) GetCount

func (m *Histogram) GetCount() isHistogram_Count

func (*Histogram) GetCountFloat

func (m *Histogram) GetCountFloat() float64

func (*Histogram) GetCountInt

func (m *Histogram) GetCountInt() uint64

func (*Histogram) GetCustomValues

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

func (*Histogram) GetNegativeCounts

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

func (*Histogram) GetNegativeDeltas

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

func (*Histogram) GetNegativeSpans

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

func (*Histogram) GetPositiveCounts

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

func (*Histogram) GetPositiveDeltas

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

func (*Histogram) GetPositiveSpans

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

func (*Histogram) GetResetHint

func (m *Histogram) GetResetHint() Histogram_ResetHint

func (*Histogram) GetSchema

func (m *Histogram) GetSchema() int32

func (*Histogram) GetSum

func (m *Histogram) GetSum() float64

func (*Histogram) GetTimestamp

func (m *Histogram) GetTimestamp() int64

func (*Histogram) GetZeroCount

func (m *Histogram) GetZeroCount() isHistogram_ZeroCount

func (*Histogram) GetZeroCountFloat

func (m *Histogram) GetZeroCountFloat() float64

func (*Histogram) GetZeroCountInt

func (m *Histogram) GetZeroCountInt() uint64

func (*Histogram) GetZeroThreshold

func (m *Histogram) GetZeroThreshold() float64

func (Histogram) IsFloatHistogram

func (h Histogram) IsFloatHistogram() bool

IsFloatHistogram returns true if the histogram is float.

func (*Histogram) Marshal

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

func (*Histogram) MarshalTo

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

func (*Histogram) MarshalToSizedBuffer

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

func (*Histogram) ProtoMessage

func (*Histogram) ProtoMessage()

func (*Histogram) Reset

func (m *Histogram) Reset()

func (*Histogram) Size

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

func (*Histogram) String

func (m *Histogram) String() string

func (Histogram) ToFloatHistogram

func (h Histogram) ToFloatHistogram() *histogram.FloatHistogram

ToFloatHistogram returns float Prometheus histogram from the remote implementation of float histogram. If the underlying implementation is an integer histogram, a conversion is performed.

func (Histogram) ToIntHistogram

func (h Histogram) ToIntHistogram() *histogram.Histogram

ToIntHistogram returns integer Prometheus histogram from the remote implementation of integer histogram. If it's a float histogram, the method returns nil.

func (*Histogram) Unmarshal

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

func (*Histogram) XXX_DiscardUnknown

func (m *Histogram) XXX_DiscardUnknown()

func (*Histogram) XXX_Marshal

func (m *Histogram) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Histogram) XXX_Merge

func (m *Histogram) XXX_Merge(src proto.Message)

func (*Histogram) XXX_OneofWrappers

func (*Histogram) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Histogram) XXX_Size

func (m *Histogram) XXX_Size() int

func (*Histogram) XXX_Unmarshal

func (m *Histogram) XXX_Unmarshal(b []byte) error

type Histogram_CountFloat

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

func (*Histogram_CountFloat) MarshalTo

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

func (*Histogram_CountFloat) MarshalToSizedBuffer

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

func (*Histogram_CountFloat) Size

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

type Histogram_CountInt

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

func (*Histogram_CountInt) MarshalTo

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

func (*Histogram_CountInt) MarshalToSizedBuffer

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

func (*Histogram_CountInt) Size

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

type Histogram_ResetHint

type Histogram_ResetHint int32
const (
	Histogram_RESET_HINT_UNSPECIFIED Histogram_ResetHint = 0
	Histogram_RESET_HINT_YES         Histogram_ResetHint = 1
	Histogram_RESET_HINT_NO          Histogram_ResetHint = 2
	Histogram_RESET_HINT_GAUGE       Histogram_ResetHint = 3
)

func (Histogram_ResetHint) EnumDescriptor

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

func (Histogram_ResetHint) String

func (x Histogram_ResetHint) String() string

type Histogram_ZeroCountFloat

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

func (*Histogram_ZeroCountFloat) MarshalTo

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

func (*Histogram_ZeroCountFloat) MarshalToSizedBuffer

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

func (*Histogram_ZeroCountFloat) Size

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

type Histogram_ZeroCountInt

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

func (*Histogram_ZeroCountInt) MarshalTo

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

func (*Histogram_ZeroCountInt) MarshalToSizedBuffer

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

func (*Histogram_ZeroCountInt) Size

func (m *Histogram_ZeroCountInt) Size() (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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

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

func (*Metadata) Descriptor

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

func (*Metadata) GetHelpRef

func (m *Metadata) GetHelpRef() uint32

func (*Metadata) GetType

func (m *Metadata) GetType() Metadata_MetricType

func (*Metadata) GetUnitRef

func (m *Metadata) GetUnitRef() uint32

func (*Metadata) Marshal

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

func (*Metadata) MarshalTo

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

func (*Metadata) MarshalToSizedBuffer

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

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) Reset

func (m *Metadata) Reset()

func (*Metadata) Size

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

func (*Metadata) String

func (m *Metadata) String() string

func (*Metadata) Unmarshal

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

func (*Metadata) XXX_DiscardUnknown

func (m *Metadata) XXX_DiscardUnknown()

func (*Metadata) XXX_Marshal

func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Metadata) XXX_Merge

func (m *Metadata) XXX_Merge(src proto.Message)

func (*Metadata) XXX_Size

func (m *Metadata) XXX_Size() int

func (*Metadata) XXX_Unmarshal

func (m *Metadata) XXX_Unmarshal(b []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 FromMetadataType

func FromMetadataType(t model.MetricType) Metadata_MetricType

FromMetadataType transforms a Prometheus metricType into writev2 metricType. Since the former is a string we need to transform it to an enum.

func (Metadata_MetricType) EnumDescriptor

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

func (Metadata_MetricType) String

func (x Metadata_MetricType) String() string

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"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

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

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

func (*Request) GetSymbols

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

func (*Request) GetTimeseries

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

func (*Request) Marshal

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

func (*Request) MarshalTo

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

func (*Request) MarshalToSizedBuffer

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

func (*Request) OptimizedMarshal

func (m *Request) OptimizedMarshal(dst []byte) ([]byte, error)

func (*Request) OptimizedMarshalToSizedBuffer

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

OptimizedMarshalToSizedBuffer is mostly a copy of the generated MarshalToSizedBuffer, but calls OptimizedMarshalToSizedBuffer on the timeseries.

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) Size

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

func (*Request) String

func (m *Request) String() string

func (*Request) Unmarshal

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

func (*Request) XXX_DiscardUnknown

func (m *Request) XXX_DiscardUnknown()

func (*Request) XXX_Marshal

func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Request) XXX_Merge

func (m *Request) XXX_Merge(src proto.Message)

func (*Request) XXX_Size

func (m *Request) XXX_Size() int

func (*Request) XXX_Unmarshal

func (m *Request) XXX_Unmarshal(b []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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Sample represents series sample.

func (*Sample) Descriptor

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

func (*Sample) GetTimestamp

func (m *Sample) GetTimestamp() int64

func (*Sample) GetValue

func (m *Sample) GetValue() float64

func (*Sample) Marshal

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

func (*Sample) MarshalTo

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

func (*Sample) MarshalToSizedBuffer

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

func (*Sample) ProtoMessage

func (*Sample) ProtoMessage()

func (*Sample) Reset

func (m *Sample) Reset()

func (*Sample) Size

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

func (*Sample) String

func (m *Sample) String() string

func (Sample) T

func (m Sample) T() int64

func (*Sample) Unmarshal

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

func (Sample) V

func (m Sample) V() float64

func (*Sample) XXX_DiscardUnknown

func (m *Sample) XXX_DiscardUnknown()

func (*Sample) XXX_Marshal

func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Sample) XXX_Merge

func (m *Sample) XXX_Merge(src proto.Message)

func (*Sample) XXX_Size

func (m *Sample) XXX_Size() int

func (*Sample) XXX_Unmarshal

func (m *Sample) XXX_Unmarshal(b []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 labels.Labels, 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"`
	Histograms []Histogram `protobuf:"bytes,3,rep,name=histograms,proto3" json:"histograms"`
	// exemplars represents an optional set of exemplars attached to this series' samples.
	Exemplars []Exemplar `protobuf:"bytes,4,rep,name=exemplars,proto3" json:"exemplars"`
	// metadata represents the metadata associated with the given series' samples.
	Metadata Metadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata"`
	// 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"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

TimeSeries represents a single series.

func (*TimeSeries) Descriptor

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

func (*TimeSeries) GetCreatedTimestamp

func (m *TimeSeries) GetCreatedTimestamp() int64

func (*TimeSeries) GetExemplars

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

func (*TimeSeries) GetHistograms

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

func (*TimeSeries) GetLabelsRefs

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

func (*TimeSeries) GetMetadata

func (m *TimeSeries) GetMetadata() Metadata

func (*TimeSeries) GetSamples

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

func (*TimeSeries) Marshal

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

func (*TimeSeries) MarshalTo

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

func (*TimeSeries) MarshalToSizedBuffer

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

func (*TimeSeries) OptimizedMarshalToSizedBuffer

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

OptimizedMarshalToSizedBuffer is mostly a copy of the generated MarshalToSizedBuffer, but marshals m.LabelsRefs in place without extra allocations.

func (*TimeSeries) ProtoMessage

func (*TimeSeries) ProtoMessage()

func (*TimeSeries) Reset

func (m *TimeSeries) Reset()

func (*TimeSeries) Size

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

func (*TimeSeries) String

func (m *TimeSeries) String() string

func (TimeSeries) ToLabels

func (m TimeSeries) ToLabels(b *labels.ScratchBuilder, symbols []string) labels.Labels

ToLabels return model labels.Labels from timeseries' remote labels.

func (TimeSeries) ToMetadata

func (m TimeSeries) ToMetadata(symbols []string) metadata.Metadata

ToMetadata return model metadata from timeseries' remote metadata.

func (*TimeSeries) Unmarshal

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

func (*TimeSeries) XXX_DiscardUnknown

func (m *TimeSeries) XXX_DiscardUnknown()

func (*TimeSeries) XXX_Marshal

func (m *TimeSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TimeSeries) XXX_Merge

func (m *TimeSeries) XXX_Merge(src proto.Message)

func (*TimeSeries) XXX_Size

func (m *TimeSeries) XXX_Size() int

func (*TimeSeries) XXX_Unmarshal

func (m *TimeSeries) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy