protoMetricsV1

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthLinmetrics = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLinmetrics   = fmt.Errorf("proto: integer overflow")
)
View Source
var SimpleFieldType_name = map[int32]string{
	0: "SIMPLE_UNSPECIFIED",
	1: "LAST",
	2: "DELTA_SUM",
	3: "Min",
	4: "Max",
	5: "FIRST",
}
View Source
var SimpleFieldType_value = map[string]int32{
	"SIMPLE_UNSPECIFIED": 0,
	"LAST":               1,
	"DELTA_SUM":          2,
	"Min":                3,
	"Max":                4,
	"FIRST":              5,
}

Functions

This section is empty.

Types

type CompoundField

type CompoundField struct {
	Exemplars []*Exemplar `protobuf:"bytes,1,rep,name=exemplars,proto3" json:"exemplars,omitempty"`
	Min       float64     `protobuf:"fixed64,2,opt,name=min,proto3" json:"min,omitempty"`
	Max       float64     `protobuf:"fixed64,3,opt,name=max,proto3" json:"max,omitempty"`
	Sum       float64     `protobuf:"fixed64,4,opt,name=sum,proto3" json:"sum,omitempty"`
	Count     float64     `protobuf:"fixed64,5,opt,name=count,proto3" json:"count,omitempty"`
	// same as open-telemetry metrics definition
	// explicit_bounds specifies buckets with explicitly defined bounds for values.
	//
	// The boundaries for bucket at index i are:
	//
	// (-infinity, explicit_bounds[i]] for i == 0
	// (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < size(explicit_bounds)
	// (explicit_bounds[i-1], +infinity) for i == size(explicit_bounds)
	//
	// The values in the explicit_bounds array must be strictly increasing.
	//
	// Histogram buckets are inclusive of their upper boundary, except the last
	// bucket where the boundary is at infinity. This format is intentionally
	// compatible with the OpenMetrics histogram definition.
	ExplicitBounds       []float64 `protobuf:"fixed64,6,rep,packed,name=explicit_bounds,json=explicitBounds,proto3" json:"explicit_bounds,omitempty"`
	Values               []float64 `protobuf:"fixed64,7,rep,packed,name=values,proto3" json:"values,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

CompoundData is compound data used for histogram field.

func (*CompoundField) Descriptor

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

func (*CompoundField) GetCount

func (m *CompoundField) GetCount() float64

func (*CompoundField) GetExemplars

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

func (*CompoundField) GetExplicitBounds

func (m *CompoundField) GetExplicitBounds() []float64

func (*CompoundField) GetMax

func (m *CompoundField) GetMax() float64

func (*CompoundField) GetMin

func (m *CompoundField) GetMin() float64

func (*CompoundField) GetSum

func (m *CompoundField) GetSum() float64

func (*CompoundField) GetValues

func (m *CompoundField) GetValues() []float64

func (*CompoundField) Marshal

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

func (*CompoundField) MarshalTo

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

func (*CompoundField) MarshalToSizedBuffer

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

func (*CompoundField) ProtoMessage

func (*CompoundField) ProtoMessage()

func (*CompoundField) Reset

func (m *CompoundField) Reset()

func (*CompoundField) Size

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

func (*CompoundField) String

func (m *CompoundField) String() string

func (*CompoundField) Unmarshal

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

func (*CompoundField) XXX_DiscardUnknown

func (m *CompoundField) XXX_DiscardUnknown()

func (*CompoundField) XXX_Marshal

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

func (*CompoundField) XXX_Merge

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

func (*CompoundField) XXX_Size

func (m *CompoundField) XXX_Size() int

func (*CompoundField) XXX_Unmarshal

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

type Exemplar

type Exemplar struct {
	// Span ID of the exemplar trace.
	SpanId []byte `protobuf:"bytes,1,opt,name=span_id,json=spanId,proto3" json:"span_id,omitempty"`
	// Trace ID of the exemplar trace.
	TraceId []byte `protobuf:"bytes,2,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
	// Duration of the exemplar span.
	Duration             int64    `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

A representation of an exemplar, which is a sample input compound-field. Exemplars in LindDB wont' hold any information about the environment it is used to record span and trace ID for a specify series.

func (*Exemplar) Descriptor

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

func (*Exemplar) GetDuration

func (m *Exemplar) GetDuration() int64

func (*Exemplar) GetSpanId

func (m *Exemplar) GetSpanId() []byte

func (*Exemplar) GetTraceId

func (m *Exemplar) GetTraceId() []byte

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

type KeyValue struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value                string   `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

KeyValue is a key-value pair that is used to store tag/label attributes

func (*KeyValue) Descriptor

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

func (*KeyValue) GetKey

func (m *KeyValue) GetKey() string

func (*KeyValue) GetValue

func (m *KeyValue) GetValue() string

func (*KeyValue) Marshal

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

func (*KeyValue) MarshalTo

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

func (*KeyValue) MarshalToSizedBuffer

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

func (*KeyValue) ProtoMessage

func (*KeyValue) ProtoMessage()

func (*KeyValue) Reset

func (m *KeyValue) Reset()

func (*KeyValue) Size

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

func (*KeyValue) String

func (m *KeyValue) String() string

func (*KeyValue) Unmarshal

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

func (*KeyValue) XXX_DiscardUnknown

func (m *KeyValue) XXX_DiscardUnknown()

func (*KeyValue) XXX_Marshal

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

func (*KeyValue) XXX_Merge

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

func (*KeyValue) XXX_Size

func (m *KeyValue) XXX_Size() int

func (*KeyValue) XXX_Unmarshal

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

type Metric

type Metric struct {
	Namespace string      `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Name      string      `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Timestamp int64       `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Tags      []*KeyValue `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"`
	// xxhash.Sum64String(tags), broker side generate before write wal
	TagsHash             uint64         `protobuf:"varint,5,opt,name=tags_hash,json=tagsHash,proto3" json:"tags_hash,omitempty"`
	SimpleFields         []*SimpleField `protobuf:"bytes,6,rep,name=simple_fields,json=simpleFields,proto3" json:"simple_fields,omitempty"`
	CompoundField        *CompoundField `protobuf:"bytes,7,opt,name=compound_field,json=compoundField,proto3" json:"compound_field,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

Defines a Metric which has one or more time series. The following is a brief summary of the Metric data model. For more details, see:

https://lindb.io/zh/docs/concept/datamodel.html

Here, "Field" is the term used to refer any specific field with exemplars. and "Data" is the term used to refer to the specific underlying value for the field.

- Metric is composed of metadata、timestamp and fields. - Metadata part contains a namespace, name, tags and its sorted-concat-string hash. - Fields is the array of the possible fields (Sum, Last, Histogram). - Fields contains exemplars, names, and the underlying value or value list

   Metric
+---------------+
|namespace      |
|name           |
|tags           |
|tags-hash      |
|timestamp      |     +------------------------------------+
|simple-fields  |---> |Last, Sum, ...                     |
|compound-field |---> |Histogram                           |
+---------------+     +------------------------------------+

SimpleField   [One of Last, DeltaSum, Min, Max ...]
+-----------+
|name       |  // field-name
|type       |  // field-type
|exemplars  |  // exemplars of series
+-----------+
|value      |
+-----------+

CompoundField  [DeltaHistogram ...]
+-----------+
|exemplars  |  // exemplars of series
+-----+-----+-----+-----+-----+-----+
|min  |max  |sum  |value|value|.....|
+-----+-----+-----+-----+-----+-----+

func (*Metric) Descriptor

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

func (*Metric) GetCompoundField

func (m *Metric) GetCompoundField() *CompoundField

func (*Metric) GetName

func (m *Metric) GetName() string

func (*Metric) GetNamespace

func (m *Metric) GetNamespace() string

func (*Metric) GetSimpleFields

func (m *Metric) GetSimpleFields() []*SimpleField

func (*Metric) GetTags

func (m *Metric) GetTags() []*KeyValue

func (*Metric) GetTagsHash

func (m *Metric) GetTagsHash() uint64

func (*Metric) GetTimestamp

func (m *Metric) GetTimestamp() int64

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 (m *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 MetricList

type MetricList struct {
	Metrics              []*Metric `protobuf:"bytes,2,rep,name=metrics,proto3" json:"metrics,omitempty"`
	XXX_NoUnkeyedLiteral struct{}  `json:"-"`
	XXX_unrecognized     []byte    `json:"-"`
	XXX_sizecache        int32     `json:"-"`
}

func (*MetricList) Descriptor

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

func (*MetricList) GetMetrics

func (m *MetricList) GetMetrics() []*Metric

func (*MetricList) Marshal

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

func (*MetricList) MarshalTo

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

func (*MetricList) MarshalToSizedBuffer

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

func (*MetricList) ProtoMessage

func (*MetricList) ProtoMessage()

func (*MetricList) Reset

func (m *MetricList) Reset()

func (*MetricList) Size

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

func (*MetricList) String

func (m *MetricList) String() string

func (*MetricList) Unmarshal

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

func (*MetricList) XXX_DiscardUnknown

func (m *MetricList) XXX_DiscardUnknown()

func (*MetricList) XXX_Marshal

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

func (*MetricList) XXX_Merge

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

func (*MetricList) XXX_Size

func (m *MetricList) XXX_Size() int

func (*MetricList) XXX_Unmarshal

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

type SimpleField

type SimpleField struct {
	Name                 string          `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Type                 SimpleFieldType `protobuf:"varint,2,opt,name=type,proto3,enum=protoMetricsV1.SimpleFieldType" json:"type,omitempty"`
	Exemplars            []*Exemplar     `protobuf:"bytes,3,rep,name=exemplars,proto3" json:"exemplars,omitempty"`
	Value                float64         `protobuf:"fixed64,4,opt,name=value,proto3" json:"value,omitempty"`
	XXX_NoUnkeyedLiteral struct{}        `json:"-"`
	XXX_unrecognized     []byte          `json:"-"`
	XXX_sizecache        int32           `json:"-"`
}

func (*SimpleField) Descriptor

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

func (*SimpleField) GetExemplars

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

func (*SimpleField) GetName

func (m *SimpleField) GetName() string

func (*SimpleField) GetType

func (m *SimpleField) GetType() SimpleFieldType

func (*SimpleField) GetValue

func (m *SimpleField) GetValue() float64

func (*SimpleField) Marshal

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

func (*SimpleField) MarshalTo

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

func (*SimpleField) MarshalToSizedBuffer

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

func (*SimpleField) ProtoMessage

func (*SimpleField) ProtoMessage()

func (*SimpleField) Reset

func (m *SimpleField) Reset()

func (*SimpleField) Size

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

func (*SimpleField) String

func (m *SimpleField) String() string

func (*SimpleField) Unmarshal

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

func (*SimpleField) XXX_DiscardUnknown

func (m *SimpleField) XXX_DiscardUnknown()

func (*SimpleField) XXX_Marshal

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

func (*SimpleField) XXX_Merge

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

func (*SimpleField) XXX_Size

func (m *SimpleField) XXX_Size() int

func (*SimpleField) XXX_Unmarshal

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

type SimpleFieldType

type SimpleFieldType int32
const (
	SimpleFieldType_SIMPLE_UNSPECIFIED SimpleFieldType = 0
	SimpleFieldType_LAST               SimpleFieldType = 1
	SimpleFieldType_DELTA_SUM          SimpleFieldType = 2
	SimpleFieldType_Min                SimpleFieldType = 3
	SimpleFieldType_Max                SimpleFieldType = 4
	SimpleFieldType_FIRST              SimpleFieldType = 5
)

func (SimpleFieldType) EnumDescriptor

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

func (SimpleFieldType) String

func (x SimpleFieldType) String() string

Jump to

Keyboard shortcuts

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