cortexpb

package
v1.18.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 27 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCortex = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCortex   = fmt.Errorf("proto: integer overflow")
)
View Source
var Histogram_ResetHint_name = map[int32]string{
	0: "UNKNOWN",
	1: "YES",
	2: "NO",
	3: "GAUGE",
}
View Source
var Histogram_ResetHint_value = map[string]int32{
	"UNKNOWN": 0,
	"YES":     1,
	"NO":      2,
	"GAUGE":   3,
}
View Source
var MetricMetadata_MetricType_name = map[int32]string{
	0: "UNKNOWN",
	1: "COUNTER",
	2: "GAUGE",
	3: "HISTOGRAM",
	4: "GAUGEHISTOGRAM",
	5: "SUMMARY",
	6: "INFO",
	7: "STATESET",
}
View Source
var MetricMetadata_MetricType_value = map[string]int32{
	"UNKNOWN":        0,
	"COUNTER":        1,
	"GAUGE":          2,
	"HISTOGRAM":      3,
	"GAUGEHISTOGRAM": 4,
	"SUMMARY":        5,
	"INFO":           6,
	"STATESET":       7,
}
View Source
var WriteRequest_SourceEnum_name = map[int32]string{
	0: "API",
	1: "RULE",
}
View Source
var WriteRequest_SourceEnum_value = map[string]int32{
	"API":  0,
	"RULE": 1,
}

Functions

func CopyLabels

func CopyLabels(input []labels.Label) labels.Labels

Efficiently copies labels input slice. To be used in cases where input slice can be reused, but long-term copy is needed.

func FloatHistogramProtoToFloatHistogram added in v1.18.0

func FloatHistogramProtoToFloatHistogram(hp Histogram) *histogram.FloatHistogram

FloatHistogramProtoToFloatHistogram extracts a float Histogram from the provided proto message. The caller has to make sure that the proto message represents a float histogram and not an integer histogram, or it panics. Changed from https://github.com/prometheus/prometheus/blob/0ab95536115adfe50af249d36d73674be694ca3f/storage/remote/codec.go#L647-L667

func FromExemplarProtosToExemplars added in v1.10.0

func FromExemplarProtosToExemplars(es []Exemplar) []exemplar.Exemplar

func FromLabelAdaptersToLabels

func FromLabelAdaptersToLabels(ls []LabelAdapter) labels.Labels

FromLabelAdaptersToLabels casts []LabelAdapter to labels.Labels. It uses unsafe, but as LabelAdapter == labels.Label this should be safe. This allows us to use labels.Labels directly in protos.

Note: while resulting labels.Labels is supposedly sorted, this function doesn't enforce that. If input is not sorted, output will be wrong.

func FromLabelAdaptersToLabelsWithCopy

func FromLabelAdaptersToLabelsWithCopy(input []LabelAdapter) labels.Labels

FromLabelAdaptersToLabelsWithCopy converts []LabelAdapter to labels.Labels. Do NOT use unsafe to convert between data types because this function may get in input labels whose data structure is reused.

func FromLabelAdaptersToMetric

func FromLabelAdaptersToMetric(ls []LabelAdapter) model.Metric

FromLabelAdaptersToMetric converts []LabelAdapter to a model.Metric. Don't do this on any performance sensitive paths.

func FromLabelAdaptersToMetricWithCopy added in v1.13.0

func FromLabelAdaptersToMetricWithCopy(ls []LabelAdapter) model.Metric

FromLabelAdaptersToMetric converts []LabelAdapter to a model.Metric with copy. Don't do this on any performance sensitive paths.

func HistogramProtoToHistogram added in v1.18.0

func HistogramProtoToHistogram(hp Histogram) *histogram.Histogram

HistogramProtoToHistogram extracts a (normal integer) Histogram from the provided proto message. The caller has to make sure that the proto message represents an interger histogram and not a float histogram. Changed from https://github.com/prometheus/prometheus/blob/0ab95536115adfe50af249d36d73674be694ca3f/storage/remote/codec.go#L626-L645

func MetricMetadataMetricTypeToMetricType

func MetricMetadataMetricTypeToMetricType(mt MetricMetadata_MetricType) model.MetricType

MetricMetadataMetricTypeToMetricType converts a metric type from our internal client to a Prometheus one.

func ReuseSlice

func ReuseSlice(ts []PreallocTimeseries)

ReuseSlice puts the slice back into a sync.Pool for reuse.

func ReuseTimeseries

func ReuseTimeseries(ts *TimeSeries)

ReuseTimeseries puts the timeseries back into a sync.Pool for reuse.

func ReuseWriteRequest added in v1.15.0

func ReuseWriteRequest(req *PreallocWriteRequest)

func SampleJsoniterDecode

func SampleJsoniterDecode(ptr unsafe.Pointer, iter *jsoniter.Iterator)

func SampleJsoniterEncode

func SampleJsoniterEncode(ptr unsafe.Pointer, stream *jsoniter.Stream)

Types

type BucketSpan added in v1.16.0

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"`
}

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 added in v1.16.0

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

func (*BucketSpan) Equal added in v1.16.0

func (this *BucketSpan) Equal(that interface{}) bool

func (*BucketSpan) GetLength added in v1.16.0

func (m *BucketSpan) GetLength() uint32

func (*BucketSpan) GetOffset added in v1.16.0

func (m *BucketSpan) GetOffset() int32

func (*BucketSpan) GoString added in v1.16.0

func (this *BucketSpan) GoString() string

func (*BucketSpan) Marshal added in v1.16.0

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

func (*BucketSpan) MarshalTo added in v1.16.0

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

func (*BucketSpan) MarshalToSizedBuffer added in v1.16.0

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

func (*BucketSpan) ProtoMessage added in v1.16.0

func (*BucketSpan) ProtoMessage()

func (*BucketSpan) Reset added in v1.16.0

func (m *BucketSpan) Reset()

func (*BucketSpan) Size added in v1.16.0

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

func (*BucketSpan) String added in v1.16.0

func (this *BucketSpan) String() string

func (*BucketSpan) Unmarshal added in v1.16.0

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

func (*BucketSpan) XXX_DiscardUnknown added in v1.16.0

func (m *BucketSpan) XXX_DiscardUnknown()

func (*BucketSpan) XXX_Marshal added in v1.16.0

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

func (*BucketSpan) XXX_Merge added in v1.16.0

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

func (*BucketSpan) XXX_Size added in v1.16.0

func (m *BucketSpan) XXX_Size() int

func (*BucketSpan) XXX_Unmarshal added in v1.16.0

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

type Exemplar added in v1.10.0

type Exemplar struct {
	// Exemplar labels, different than series labels
	Labels      []LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=LabelAdapter" json:"labels"`
	Value       float64        `protobuf:"fixed64,2,opt,name=value,proto3" json:"value,omitempty"`
	TimestampMs int64          `protobuf:"varint,3,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"`
}

func FromExemplarsToExemplarProtos added in v1.10.0

func FromExemplarsToExemplarProtos(es []exemplar.Exemplar) []Exemplar

func (*Exemplar) Descriptor added in v1.10.0

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

func (*Exemplar) Equal added in v1.10.0

func (this *Exemplar) Equal(that interface{}) bool

func (*Exemplar) GetTimestampMs added in v1.10.0

func (m *Exemplar) GetTimestampMs() int64

func (*Exemplar) GetValue added in v1.10.0

func (m *Exemplar) GetValue() float64

func (*Exemplar) GoString added in v1.10.0

func (this *Exemplar) GoString() string

func (*Exemplar) Marshal added in v1.10.0

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

func (*Exemplar) MarshalTo added in v1.10.0

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

func (*Exemplar) MarshalToSizedBuffer added in v1.10.0

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

func (*Exemplar) ProtoMessage added in v1.10.0

func (*Exemplar) ProtoMessage()

func (*Exemplar) Reset added in v1.10.0

func (m *Exemplar) Reset()

func (*Exemplar) Size added in v1.10.0

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

func (*Exemplar) String added in v1.10.0

func (this *Exemplar) String() string

func (*Exemplar) Unmarshal added in v1.10.0

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

func (*Exemplar) XXX_DiscardUnknown added in v1.10.0

func (m *Exemplar) XXX_DiscardUnknown()

func (*Exemplar) XXX_Marshal added in v1.10.0

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

func (*Exemplar) XXX_Merge added in v1.10.0

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

func (*Exemplar) XXX_Size added in v1.10.0

func (m *Exemplar) XXX_Size() int

func (*Exemplar) XXX_Unmarshal added in v1.10.0

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

type Histogram added in v1.16.0

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 -4 <= n <= 8. They are all for base-2 bucket schemas, where 1
	// is a bucket boundary in each case, and then each power of two is
	// divided into 2^n logarithmic buckets. Or in other words, each
	// bucket boundary is the previous boundary times 2^(2^-n). In the
	// future, more bucket schemas may be added using numbers < -4 or >
	// 8.
	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.
	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 `protobuf:"varint,14,opt,name=reset_hint,json=resetHint,proto3,enum=cortexpb.Histogram_ResetHint" json:"reset_hint,omitempty"`
	// timestamp is in ms format, see model/timestamp/timestamp.go for
	// conversion from time.Time to Prometheus timestamp.
	TimestampMs int64 `protobuf:"varint,15,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"`
}

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 FloatHistogramToHistogramProto added in v1.18.0

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

FloatHistogramToHistogramProto converts a float Histogram to a normal Histogram's protobuf message type. Changed from https://github.com/prometheus/prometheus/blob/0ab95536115adfe50af249d36d73674be694ca3f/storage/remote/codec.go#L725-L739

func HistogramPromProtoToHistogramProto added in v1.18.0

func HistogramPromProtoToHistogramProto(h prompb.Histogram) Histogram

HistogramPromProtoToHistogramProto converts a prometheus protobuf Histogram to cortex protobuf Histogram.

func HistogramToHistogramProto added in v1.18.0

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

HistogramToHistogramProto converts a (normal integer) Histogram to its protobuf message type. Changed from https://github.com/prometheus/prometheus/blob/0ab95536115adfe50af249d36d73674be694ca3f/storage/remote/codec.go#L709-L723

func (*Histogram) Descriptor added in v1.16.0

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

func (*Histogram) Equal added in v1.16.0

func (this *Histogram) Equal(that interface{}) bool

func (*Histogram) GetCount added in v1.16.0

func (m *Histogram) GetCount() isHistogram_Count

func (*Histogram) GetCountFloat added in v1.16.0

func (m *Histogram) GetCountFloat() float64

func (*Histogram) GetCountInt added in v1.16.0

func (m *Histogram) GetCountInt() uint64

func (*Histogram) GetNegativeCounts added in v1.16.0

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

func (*Histogram) GetNegativeDeltas added in v1.16.0

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

func (*Histogram) GetNegativeSpans added in v1.16.0

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

func (*Histogram) GetPositiveCounts added in v1.16.0

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

func (*Histogram) GetPositiveDeltas added in v1.16.0

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

func (*Histogram) GetPositiveSpans added in v1.16.0

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

func (*Histogram) GetResetHint added in v1.16.0

func (m *Histogram) GetResetHint() Histogram_ResetHint

func (*Histogram) GetSchema added in v1.16.0

func (m *Histogram) GetSchema() int32

func (*Histogram) GetSum added in v1.16.0

func (m *Histogram) GetSum() float64

func (*Histogram) GetTimestampMs added in v1.16.0

func (m *Histogram) GetTimestampMs() int64

func (*Histogram) GetZeroCount added in v1.16.0

func (m *Histogram) GetZeroCount() isHistogram_ZeroCount

func (*Histogram) GetZeroCountFloat added in v1.16.0

func (m *Histogram) GetZeroCountFloat() float64

func (*Histogram) GetZeroCountInt added in v1.16.0

func (m *Histogram) GetZeroCountInt() uint64

func (*Histogram) GetZeroThreshold added in v1.16.0

func (m *Histogram) GetZeroThreshold() float64

func (*Histogram) GoString added in v1.16.0

func (this *Histogram) GoString() string

func (Histogram) IsFloatHistogram added in v1.18.0

func (h Histogram) IsFloatHistogram() bool

func (*Histogram) Marshal added in v1.16.0

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

func (*Histogram) MarshalTo added in v1.16.0

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

func (*Histogram) MarshalToSizedBuffer added in v1.16.0

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

func (*Histogram) ProtoMessage added in v1.16.0

func (*Histogram) ProtoMessage()

func (*Histogram) Reset added in v1.16.0

func (m *Histogram) Reset()

func (*Histogram) Size added in v1.16.0

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

func (*Histogram) String added in v1.16.0

func (this *Histogram) String() string

func (*Histogram) Unmarshal added in v1.16.0

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

func (*Histogram) XXX_DiscardUnknown added in v1.16.0

func (m *Histogram) XXX_DiscardUnknown()

func (*Histogram) XXX_Marshal added in v1.16.0

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

func (*Histogram) XXX_Merge added in v1.16.0

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

func (*Histogram) XXX_OneofWrappers added in v1.16.0

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

XXX_OneofWrappers is for the internal use of the proto package.

func (*Histogram) XXX_Size added in v1.16.0

func (m *Histogram) XXX_Size() int

func (*Histogram) XXX_Unmarshal added in v1.16.0

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

type Histogram_CountFloat added in v1.16.0

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

func (*Histogram_CountFloat) Equal added in v1.16.0

func (this *Histogram_CountFloat) Equal(that interface{}) bool

func (*Histogram_CountFloat) GoString added in v1.16.0

func (this *Histogram_CountFloat) GoString() string

func (*Histogram_CountFloat) MarshalTo added in v1.16.0

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

func (*Histogram_CountFloat) MarshalToSizedBuffer added in v1.16.0

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

func (*Histogram_CountFloat) Size added in v1.16.0

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

func (*Histogram_CountFloat) String added in v1.16.0

func (this *Histogram_CountFloat) String() string

type Histogram_CountInt added in v1.16.0

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

func (*Histogram_CountInt) Equal added in v1.16.0

func (this *Histogram_CountInt) Equal(that interface{}) bool

func (*Histogram_CountInt) GoString added in v1.16.0

func (this *Histogram_CountInt) GoString() string

func (*Histogram_CountInt) MarshalTo added in v1.16.0

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

func (*Histogram_CountInt) MarshalToSizedBuffer added in v1.16.0

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

func (*Histogram_CountInt) Size added in v1.16.0

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

func (*Histogram_CountInt) String added in v1.16.0

func (this *Histogram_CountInt) String() string

type Histogram_ResetHint added in v1.16.0

type Histogram_ResetHint int32
const (
	Histogram_UNKNOWN Histogram_ResetHint = 0
	Histogram_YES     Histogram_ResetHint = 1
	Histogram_NO      Histogram_ResetHint = 2
	Histogram_GAUGE   Histogram_ResetHint = 3
)

func (Histogram_ResetHint) EnumDescriptor added in v1.16.0

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

func (Histogram_ResetHint) String added in v1.16.0

func (x Histogram_ResetHint) String() string

type Histogram_ZeroCountFloat added in v1.16.0

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

func (*Histogram_ZeroCountFloat) Equal added in v1.16.0

func (this *Histogram_ZeroCountFloat) Equal(that interface{}) bool

func (*Histogram_ZeroCountFloat) GoString added in v1.16.0

func (this *Histogram_ZeroCountFloat) GoString() string

func (*Histogram_ZeroCountFloat) MarshalTo added in v1.16.0

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

func (*Histogram_ZeroCountFloat) MarshalToSizedBuffer added in v1.16.0

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

func (*Histogram_ZeroCountFloat) Size added in v1.16.0

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

func (*Histogram_ZeroCountFloat) String added in v1.16.0

func (this *Histogram_ZeroCountFloat) String() string

type Histogram_ZeroCountInt added in v1.16.0

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

func (*Histogram_ZeroCountInt) Equal added in v1.16.0

func (this *Histogram_ZeroCountInt) Equal(that interface{}) bool

func (*Histogram_ZeroCountInt) GoString added in v1.16.0

func (this *Histogram_ZeroCountInt) GoString() string

func (*Histogram_ZeroCountInt) MarshalTo added in v1.16.0

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

func (*Histogram_ZeroCountInt) MarshalToSizedBuffer added in v1.16.0

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

func (*Histogram_ZeroCountInt) Size added in v1.16.0

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

func (*Histogram_ZeroCountInt) String added in v1.16.0

func (this *Histogram_ZeroCountInt) String() string

type LabelAdapter

type LabelAdapter labels.Label

LabelAdapter is a labels.Label that can be marshalled to/from protos.

func FromLabelsToLabelAdapters

func FromLabelsToLabelAdapters(ls labels.Labels) []LabelAdapter

FromLabelsToLabelAdapters casts labels.Labels to []LabelAdapter. It uses unsafe, but as LabelAdapter == labels.Label this should be safe. This allows us to use labels.Labels directly in protos.

func FromMetricsToLabelAdapters

func FromMetricsToLabelAdapters(metric model.Metric) []LabelAdapter

FromMetricsToLabelAdapters converts model.Metric to []LabelAdapter. Don't do this on any performance sensitive paths. The result is sorted.

func (*LabelAdapter) Compare

func (bs *LabelAdapter) Compare(other LabelAdapter) int

Compare implements proto.Comparer.

func (*LabelAdapter) Equal

func (bs *LabelAdapter) Equal(other LabelAdapter) bool

Equal implements proto.Equaler.

func (*LabelAdapter) Marshal

func (bs *LabelAdapter) Marshal() ([]byte, error)

Marshal implements proto.Marshaller.

func (*LabelAdapter) MarshalTo

func (bs *LabelAdapter) MarshalTo(dAtA []byte) (int, error)

func (*LabelAdapter) MarshalToSizedBuffer

func (bs *LabelAdapter) MarshalToSizedBuffer(buf []byte) (n int, err error)

MarshalTo implements proto.Marshaller.

func (*LabelAdapter) Size

func (bs *LabelAdapter) Size() (n int)

Size implements proto.Sizer.

func (*LabelAdapter) Unmarshal

func (bs *LabelAdapter) Unmarshal(dAtA []byte) error

Unmarshal a LabelAdapter, implements proto.Unmarshaller. NB this is a copy of the autogenerated code to unmarshal a LabelPair, with the byte copying replaced with a yoloString.

type LabelPair

type LabelPair struct {
	Name  []byte `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*LabelPair) Descriptor

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

func (*LabelPair) Equal

func (this *LabelPair) Equal(that interface{}) bool

func (*LabelPair) GetName

func (m *LabelPair) GetName() []byte

func (*LabelPair) GetValue

func (m *LabelPair) GetValue() []byte

func (*LabelPair) GoString

func (this *LabelPair) GoString() string

func (*LabelPair) Marshal

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

func (*LabelPair) MarshalTo

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

func (*LabelPair) MarshalToSizedBuffer

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

func (*LabelPair) ProtoMessage

func (*LabelPair) ProtoMessage()

func (*LabelPair) Reset

func (m *LabelPair) Reset()

func (*LabelPair) Size

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

func (*LabelPair) String

func (this *LabelPair) String() string

func (*LabelPair) Unmarshal

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

func (*LabelPair) XXX_DiscardUnknown

func (m *LabelPair) XXX_DiscardUnknown()

func (*LabelPair) XXX_Marshal

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

func (*LabelPair) XXX_Merge

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

func (*LabelPair) XXX_Size

func (m *LabelPair) XXX_Size() int

func (*LabelPair) XXX_Unmarshal

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

type Metric

type Metric struct {
	Labels []LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=LabelAdapter" json:"labels"`
}

func (*Metric) Descriptor

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

func (*Metric) Equal

func (this *Metric) Equal(that interface{}) bool

func (*Metric) GoString

func (this *Metric) GoString() string

func (*Metric) Marshal

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

func (*Metric) MarshalTo

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

func (*Metric) MarshalToSizedBuffer

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

func (*Metric) ProtoMessage

func (*Metric) ProtoMessage()

func (*Metric) Reset

func (m *Metric) Reset()

func (*Metric) Size

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

func (*Metric) String

func (this *Metric) String() string

func (*Metric) Unmarshal

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

func (*Metric) XXX_DiscardUnknown

func (m *Metric) XXX_DiscardUnknown()

func (*Metric) XXX_Marshal

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

func (*Metric) XXX_Merge

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

func (*Metric) XXX_Size

func (m *Metric) XXX_Size() int

func (*Metric) XXX_Unmarshal

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

type MetricMetadata

type MetricMetadata struct {
	Type             MetricMetadata_MetricType `protobuf:"varint,1,opt,name=type,proto3,enum=cortexpb.MetricMetadata_MetricType" json:"type,omitempty"`
	MetricFamilyName string                    `protobuf:"bytes,2,opt,name=metric_family_name,json=metricFamilyName,proto3" json:"metric_family_name,omitempty"`
	Help             string                    `protobuf:"bytes,4,opt,name=help,proto3" json:"help,omitempty"`
	Unit             string                    `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"`
}

func (*MetricMetadata) Descriptor

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

func (*MetricMetadata) Equal

func (this *MetricMetadata) Equal(that interface{}) bool

func (*MetricMetadata) GetHelp

func (m *MetricMetadata) GetHelp() string

func (*MetricMetadata) GetMetricFamilyName

func (m *MetricMetadata) GetMetricFamilyName() string

func (*MetricMetadata) GetType

func (*MetricMetadata) GetUnit

func (m *MetricMetadata) GetUnit() string

func (*MetricMetadata) GoString

func (this *MetricMetadata) GoString() string

func (*MetricMetadata) Marshal

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

func (*MetricMetadata) MarshalTo

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

func (*MetricMetadata) MarshalToSizedBuffer

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

func (*MetricMetadata) ProtoMessage

func (*MetricMetadata) ProtoMessage()

func (*MetricMetadata) Reset

func (m *MetricMetadata) Reset()

func (*MetricMetadata) Size

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

func (*MetricMetadata) String

func (this *MetricMetadata) String() string

func (*MetricMetadata) Unmarshal

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

func (*MetricMetadata) XXX_DiscardUnknown

func (m *MetricMetadata) XXX_DiscardUnknown()

func (*MetricMetadata) XXX_Marshal

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

func (*MetricMetadata) XXX_Merge

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

func (*MetricMetadata) XXX_Size

func (m *MetricMetadata) XXX_Size() int

func (*MetricMetadata) XXX_Unmarshal

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

type MetricMetadata_MetricType

type MetricMetadata_MetricType int32

func (MetricMetadata_MetricType) EnumDescriptor

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

func (MetricMetadata_MetricType) String

func (x MetricMetadata_MetricType) String() string

type PreallocConfig

type PreallocConfig struct{}

PreallocConfig configures how structures will be preallocated to optimise proto unmarshalling.

func (PreallocConfig) RegisterFlags

func (PreallocConfig) RegisterFlags(f *flag.FlagSet)

RegisterFlags registers configuration settings.

type PreallocTimeseries

type PreallocTimeseries struct {
	*TimeSeries
}

PreallocTimeseries is a TimeSeries which preallocs slices on Unmarshal.

func PreallocTimeseriesSliceFromPool

func PreallocTimeseriesSliceFromPool() []PreallocTimeseries

PreallocTimeseriesSliceFromPool retrieves a slice of PreallocTimeseries from a sync.Pool. ReuseSlice should be called once done.

func (*PreallocTimeseries) Unmarshal

func (p *PreallocTimeseries) Unmarshal(dAtA []byte) error

Unmarshal implements proto.Message.

type PreallocWriteRequest

type PreallocWriteRequest struct {
	WriteRequest
	// contains filtered or unexported fields
}

PreallocWriteRequest is a WriteRequest which preallocs slices on Unmarshal.

func PreallocWriteRequestFromPool added in v1.15.0

func PreallocWriteRequestFromPool() *PreallocWriteRequest

func (*PreallocWriteRequest) Marshal added in v1.15.0

func (p *PreallocWriteRequest) Marshal() (dAtA []byte, err error)

func (*PreallocWriteRequest) Unmarshal

func (p *PreallocWriteRequest) Unmarshal(dAtA []byte) error

Unmarshal implements proto.Message.

type Sample

type Sample struct {
	Value       float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"`
	TimestampMs int64   `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs,proto3" json:"timestamp_ms,omitempty"`
}

func (*Sample) Descriptor

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

func (*Sample) Equal

func (this *Sample) Equal(that interface{}) bool

func (*Sample) GetTimestampMs

func (m *Sample) GetTimestampMs() int64

func (*Sample) GetValue

func (m *Sample) GetValue() float64

func (*Sample) GoString

func (this *Sample) GoString() string

func (*Sample) Marshal

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

func (Sample) MarshalJSON

func (s Sample) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

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 (this *Sample) String() string

func (*Sample) Unmarshal

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

func (*Sample) UnmarshalJSON

func (s *Sample) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

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 TimeSeries

type TimeSeries struct {
	Labels []LabelAdapter `protobuf:"bytes,1,rep,name=labels,proto3,customtype=LabelAdapter" json:"labels"`
	// Sorted by time, oldest sample first.
	Samples    []Sample    `protobuf:"bytes,2,rep,name=samples,proto3" json:"samples"`
	Exemplars  []Exemplar  `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars"`
	Histograms []Histogram `protobuf:"bytes,4,rep,name=histograms,proto3" json:"histograms"`
}

func TimeseriesFromPool

func TimeseriesFromPool() *TimeSeries

TimeseriesFromPool retrieves a pointer to a TimeSeries from a sync.Pool. ReuseTimeseries should be called once done, unless ReuseSlice was called on the slice that contains this TimeSeries.

func (*TimeSeries) Descriptor

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

func (*TimeSeries) Equal

func (this *TimeSeries) Equal(that interface{}) bool

func (*TimeSeries) GetExemplars added in v1.10.0

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

func (*TimeSeries) GetHistograms added in v1.16.0

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

func (*TimeSeries) GetSamples

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

func (*TimeSeries) GoString

func (this *TimeSeries) GoString() string

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) ProtoMessage

func (*TimeSeries) ProtoMessage()

func (*TimeSeries) Reset

func (m *TimeSeries) Reset()

func (*TimeSeries) Size

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

func (*TimeSeries) String

func (this *TimeSeries) String() string

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

type WriteRequest

type WriteRequest struct {
	Timeseries              []PreallocTimeseries    `protobuf:"bytes,1,rep,name=timeseries,proto3,customtype=PreallocTimeseries" json:"timeseries"`
	Source                  WriteRequest_SourceEnum `protobuf:"varint,2,opt,name=Source,proto3,enum=cortexpb.WriteRequest_SourceEnum" json:"Source,omitempty"`
	Metadata                []*MetricMetadata       `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty"`
	SkipLabelNameValidation bool                    `` /* 138-byte string literal not displayed */
}

func ToWriteRequest

func ToWriteRequest(lbls []labels.Labels, samples []Sample, metadata []*MetricMetadata, histograms []Histogram, source WriteRequest_SourceEnum) *WriteRequest

ToWriteRequest converts matched slices of Labels, Samples, Metadata and Histograms into a WriteRequest proto. It gets timeseries from the pool, so ReuseSlice() should be called when done.

func (*WriteRequest) AddHistogramTimeSeries added in v1.18.0

func (w *WriteRequest) AddHistogramTimeSeries(lbls []labels.Labels, histograms []Histogram)

func (*WriteRequest) Descriptor

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

func (*WriteRequest) Equal

func (this *WriteRequest) Equal(that interface{}) bool

func (*WriteRequest) GetMetadata

func (m *WriteRequest) GetMetadata() []*MetricMetadata

func (*WriteRequest) GetSkipLabelNameValidation

func (m *WriteRequest) GetSkipLabelNameValidation() bool

func (*WriteRequest) GetSource

func (m *WriteRequest) GetSource() WriteRequest_SourceEnum

func (*WriteRequest) GoString

func (this *WriteRequest) GoString() string

func (*WriteRequest) Marshal

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

func (*WriteRequest) MarshalTo

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

func (*WriteRequest) MarshalToSizedBuffer

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

func (*WriteRequest) ProtoMessage

func (*WriteRequest) ProtoMessage()

func (*WriteRequest) Reset

func (m *WriteRequest) Reset()

func (*WriteRequest) Sign added in v1.16.0

func (w *WriteRequest) Sign(ctx context.Context) (string, error)

func (*WriteRequest) Size

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

func (*WriteRequest) String

func (this *WriteRequest) String() string

func (*WriteRequest) Unmarshal

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

func (*WriteRequest) VerifySign added in v1.16.0

func (w *WriteRequest) VerifySign(ctx context.Context, signature string) (bool, error)

func (*WriteRequest) XXX_DiscardUnknown

func (m *WriteRequest) XXX_DiscardUnknown()

func (*WriteRequest) XXX_Marshal

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

func (*WriteRequest) XXX_Merge

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

func (*WriteRequest) XXX_Size

func (m *WriteRequest) XXX_Size() int

func (*WriteRequest) XXX_Unmarshal

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

type WriteRequest_SourceEnum

type WriteRequest_SourceEnum int32

func (WriteRequest_SourceEnum) EnumDescriptor

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

func (WriteRequest_SourceEnum) String

func (x WriteRequest_SourceEnum) String() string

type WriteResponse

type WriteResponse struct {
}

func (*WriteResponse) Descriptor

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

func (*WriteResponse) Equal

func (this *WriteResponse) Equal(that interface{}) bool

func (*WriteResponse) GoString

func (this *WriteResponse) GoString() string

func (*WriteResponse) Marshal

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

func (*WriteResponse) MarshalTo

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

func (*WriteResponse) MarshalToSizedBuffer

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

func (*WriteResponse) ProtoMessage

func (*WriteResponse) ProtoMessage()

func (*WriteResponse) Reset

func (m *WriteResponse) Reset()

func (*WriteResponse) Size

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

func (*WriteResponse) String

func (this *WriteResponse) String() string

func (*WriteResponse) Unmarshal

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

func (*WriteResponse) XXX_DiscardUnknown

func (m *WriteResponse) XXX_DiscardUnknown()

func (*WriteResponse) XXX_Marshal

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

func (*WriteResponse) XXX_Merge

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

func (*WriteResponse) XXX_Size

func (m *WriteResponse) XXX_Size() int

func (*WriteResponse) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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