Documentation
¶
Index ¶
- Variables
- type BucketSpan
- func (*BucketSpan) Descriptor() ([]byte, []int)
- func (m *BucketSpan) GetLength() uint32
- func (m *BucketSpan) GetOffset() int32
- func (m *BucketSpan) Marshal() (dAtA []byte, err error)
- func (m *BucketSpan) MarshalTo(dAtA []byte) (int, error)
- func (m *BucketSpan) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*BucketSpan) ProtoMessage()
- func (m *BucketSpan) Reset()
- func (m *BucketSpan) Size() (n int)
- func (m *BucketSpan) String() string
- func (m *BucketSpan) Unmarshal(dAtA []byte) error
- func (m *BucketSpan) XXX_DiscardUnknown()
- func (m *BucketSpan) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BucketSpan) XXX_Merge(src proto.Message)
- func (m *BucketSpan) XXX_Size() int
- func (m *BucketSpan) XXX_Unmarshal(b []byte) error
- type Exemplar
- func (*Exemplar) Descriptor() ([]byte, []int)
- func (m *Exemplar) GetLabelsRefs() []uint32
- func (m *Exemplar) GetTimestamp() int64
- func (m *Exemplar) GetValue() float64
- func (m *Exemplar) Marshal() (dAtA []byte, err error)
- func (m *Exemplar) MarshalTo(dAtA []byte) (int, error)
- func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Exemplar) ProtoMessage()
- func (m *Exemplar) Reset()
- func (m *Exemplar) Size() (n int)
- func (m *Exemplar) String() string
- func (m Exemplar) ToExemplar(b *labels.ScratchBuilder, symbols []string) exemplar.Exemplar
- func (m *Exemplar) Unmarshal(dAtA []byte) error
- func (m *Exemplar) XXX_DiscardUnknown()
- func (m *Exemplar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Exemplar) XXX_Merge(src proto.Message)
- func (m *Exemplar) XXX_Size() int
- func (m *Exemplar) XXX_Unmarshal(b []byte) error
- type Histogram
- func (*Histogram) Descriptor() ([]byte, []int)
- func (m *Histogram) GetCount() isHistogram_Count
- func (m *Histogram) GetCountFloat() float64
- func (m *Histogram) GetCountInt() uint64
- func (m *Histogram) GetCustomValues() []float64
- func (m *Histogram) GetNegativeCounts() []float64
- func (m *Histogram) GetNegativeDeltas() []int64
- func (m *Histogram) GetNegativeSpans() []BucketSpan
- func (m *Histogram) GetPositiveCounts() []float64
- func (m *Histogram) GetPositiveDeltas() []int64
- func (m *Histogram) GetPositiveSpans() []BucketSpan
- func (m *Histogram) GetResetHint() Histogram_ResetHint
- func (m *Histogram) GetSchema() int32
- func (m *Histogram) GetSum() float64
- func (m *Histogram) GetTimestamp() int64
- func (m *Histogram) GetZeroCount() isHistogram_ZeroCount
- func (m *Histogram) GetZeroCountFloat() float64
- func (m *Histogram) GetZeroCountInt() uint64
- func (m *Histogram) GetZeroThreshold() float64
- func (h Histogram) IsFloatHistogram() bool
- func (m *Histogram) Marshal() (dAtA []byte, err error)
- func (m *Histogram) MarshalTo(dAtA []byte) (int, error)
- func (m *Histogram) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Histogram) ProtoMessage()
- func (m *Histogram) Reset()
- func (m *Histogram) Size() (n int)
- func (m *Histogram) String() string
- func (h Histogram) ToFloatHistogram() *histogram.FloatHistogram
- func (h Histogram) ToIntHistogram() *histogram.Histogram
- func (m *Histogram) Unmarshal(dAtA []byte) error
- func (m *Histogram) XXX_DiscardUnknown()
- func (m *Histogram) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Histogram) XXX_Merge(src proto.Message)
- func (*Histogram) XXX_OneofWrappers() []interface{}
- func (m *Histogram) XXX_Size() int
- func (m *Histogram) XXX_Unmarshal(b []byte) error
- type Histogram_CountFloat
- type Histogram_CountInt
- type Histogram_ResetHint
- type Histogram_ZeroCountFloat
- type Histogram_ZeroCountInt
- type Metadata
- func (*Metadata) Descriptor() ([]byte, []int)
- func (m *Metadata) GetHelpRef() uint32
- func (m *Metadata) GetType() Metadata_MetricType
- func (m *Metadata) GetUnitRef() uint32
- func (m *Metadata) Marshal() (dAtA []byte, err error)
- func (m *Metadata) MarshalTo(dAtA []byte) (int, error)
- func (m *Metadata) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Metadata) ProtoMessage()
- func (m *Metadata) Reset()
- func (m *Metadata) Size() (n int)
- func (m *Metadata) String() string
- func (m *Metadata) Unmarshal(dAtA []byte) error
- func (m *Metadata) XXX_DiscardUnknown()
- func (m *Metadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Metadata) XXX_Merge(src proto.Message)
- func (m *Metadata) XXX_Size() int
- func (m *Metadata) XXX_Unmarshal(b []byte) error
- type Metadata_MetricType
- type Request
- func (*Request) Descriptor() ([]byte, []int)
- func (m *Request) GetSymbols() []string
- func (m *Request) GetTimeseries() []TimeSeries
- func (m *Request) Marshal() (dAtA []byte, err error)
- func (m *Request) MarshalTo(dAtA []byte) (int, error)
- func (m *Request) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *Request) OptimizedMarshal(dst []byte) ([]byte, error)
- func (m *Request) OptimizedMarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) Size() (n int)
- func (m *Request) String() string
- func (m *Request) Unmarshal(dAtA []byte) error
- func (m *Request) XXX_DiscardUnknown()
- func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Request) XXX_Merge(src proto.Message)
- func (m *Request) XXX_Size() int
- func (m *Request) XXX_Unmarshal(b []byte) error
- type Sample
- func (*Sample) Descriptor() ([]byte, []int)
- func (m *Sample) GetTimestamp() int64
- func (m *Sample) GetValue() float64
- func (m *Sample) Marshal() (dAtA []byte, err error)
- func (m *Sample) MarshalTo(dAtA []byte) (int, error)
- func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Sample) ProtoMessage()
- func (m *Sample) Reset()
- func (m *Sample) Size() (n int)
- func (m *Sample) String() string
- func (m Sample) T() int64
- func (m *Sample) Unmarshal(dAtA []byte) error
- func (m Sample) V() float64
- func (m *Sample) XXX_DiscardUnknown()
- func (m *Sample) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Sample) XXX_Merge(src proto.Message)
- func (m *Sample) XXX_Size() int
- func (m *Sample) XXX_Unmarshal(b []byte) error
- type SymbolsTable
- type TimeSeries
- func (*TimeSeries) Descriptor() ([]byte, []int)
- func (m *TimeSeries) GetCreatedTimestamp() int64
- func (m *TimeSeries) GetExemplars() []Exemplar
- func (m *TimeSeries) GetHistograms() []Histogram
- func (m *TimeSeries) GetLabelsRefs() []uint32
- func (m *TimeSeries) GetMetadata() Metadata
- func (m *TimeSeries) GetSamples() []Sample
- func (m *TimeSeries) Marshal() (dAtA []byte, err error)
- func (m *TimeSeries) MarshalTo(dAtA []byte) (int, error)
- func (m *TimeSeries) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (m *TimeSeries) OptimizedMarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TimeSeries) ProtoMessage()
- func (m *TimeSeries) Reset()
- func (m *TimeSeries) Size() (n int)
- func (m *TimeSeries) String() string
- func (m TimeSeries) ToLabels(b *labels.ScratchBuilder, symbols []string) labels.Labels
- func (m TimeSeries) ToMetadata(symbols []string) metadata.Metadata
- func (m *TimeSeries) Unmarshal(dAtA []byte) error
- func (m *TimeSeries) XXX_DiscardUnknown()
- func (m *TimeSeries) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TimeSeries) XXX_Merge(src proto.Message)
- func (m *TimeSeries) XXX_Size() int
- func (m *TimeSeries) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
var Histogram_ResetHint_name = map[int32]string{
0: "RESET_HINT_UNSPECIFIED",
1: "RESET_HINT_YES",
2: "RESET_HINT_NO",
3: "RESET_HINT_GAUGE",
}
var Histogram_ResetHint_value = map[string]int32{
"RESET_HINT_UNSPECIFIED": 0,
"RESET_HINT_YES": 1,
"RESET_HINT_NO": 2,
"RESET_HINT_GAUGE": 3,
}
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",
}
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) 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) GetLabelsRefs ¶
func (*Exemplar) GetTimestamp ¶
func (*Exemplar) MarshalToSizedBuffer ¶
func (*Exemplar) ProtoMessage ¶
func (*Exemplar) ProtoMessage()
func (Exemplar) ToExemplar ¶
func (*Exemplar) XXX_DiscardUnknown ¶
func (m *Exemplar) XXX_DiscardUnknown()
func (*Exemplar) XXX_Marshal ¶
func (*Exemplar) XXX_Unmarshal ¶
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 ¶
FromIntHistogram returns remote Histogram from the integer Histogram.
func (*Histogram) Descriptor ¶
func (*Histogram) GetCountFloat ¶
func (*Histogram) GetCountInt ¶
func (*Histogram) GetCustomValues ¶
func (*Histogram) GetNegativeCounts ¶
func (*Histogram) GetNegativeDeltas ¶
func (*Histogram) GetNegativeSpans ¶
func (m *Histogram) GetNegativeSpans() []BucketSpan
func (*Histogram) GetPositiveCounts ¶
func (*Histogram) GetPositiveDeltas ¶
func (*Histogram) GetPositiveSpans ¶
func (m *Histogram) GetPositiveSpans() []BucketSpan
func (*Histogram) GetResetHint ¶
func (m *Histogram) GetResetHint() Histogram_ResetHint
func (*Histogram) GetTimestamp ¶
func (*Histogram) GetZeroCount ¶
func (m *Histogram) GetZeroCount() isHistogram_ZeroCount
func (*Histogram) GetZeroCountFloat ¶
func (*Histogram) GetZeroCountInt ¶
func (*Histogram) GetZeroThreshold ¶
func (Histogram) IsFloatHistogram ¶
IsFloatHistogram returns true if the histogram is float.
func (*Histogram) MarshalToSizedBuffer ¶
func (*Histogram) ProtoMessage ¶
func (*Histogram) ProtoMessage()
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 ¶
ToIntHistogram returns integer Prometheus histogram from the remote implementation of integer histogram. If it's a float histogram, the method returns nil.
func (*Histogram) XXX_DiscardUnknown ¶
func (m *Histogram) XXX_DiscardUnknown()
func (*Histogram) XXX_Marshal ¶
func (*Histogram) XXX_OneofWrappers ¶
func (*Histogram) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Histogram) XXX_Unmarshal ¶
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) GetHelpRef ¶
func (*Metadata) GetType ¶
func (m *Metadata) GetType() Metadata_MetricType
func (*Metadata) GetUnitRef ¶
func (*Metadata) MarshalToSizedBuffer ¶
func (*Metadata) ProtoMessage ¶
func (*Metadata) ProtoMessage()
func (*Metadata) XXX_DiscardUnknown ¶
func (m *Metadata) XXX_DiscardUnknown()
func (*Metadata) XXX_Marshal ¶
func (*Metadata) XXX_Unmarshal ¶
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) GetSymbols ¶
func (*Request) GetTimeseries ¶
func (m *Request) GetTimeseries() []TimeSeries
func (*Request) MarshalToSizedBuffer ¶
func (*Request) OptimizedMarshalToSizedBuffer ¶
OptimizedMarshalToSizedBuffer is mostly a copy of the generated MarshalToSizedBuffer, but calls OptimizedMarshalToSizedBuffer on the timeseries.
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) XXX_DiscardUnknown ¶
func (m *Request) XXX_DiscardUnknown()
func (*Request) XXX_Marshal ¶
func (*Request) XXX_Unmarshal ¶
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) GetTimestamp ¶
func (*Sample) MarshalToSizedBuffer ¶
func (*Sample) ProtoMessage ¶
func (*Sample) ProtoMessage()
func (*Sample) XXX_DiscardUnknown ¶
func (m *Sample) XXX_DiscardUnknown()
func (*Sample) XXX_Marshal ¶
func (*Sample) XXX_Unmarshal ¶
type SymbolsTable ¶
type SymbolsTable struct {
// contains filtered or unexported fields
}
SymbolsTable implements table for easy symbol use.
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) 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