Documentation ¶
Overview ¶
Copied from prometheus.
Index ¶
- Constants
- func FromFloatHistogram(timestamp int64, fh *histogram.FloatHistogram) prompb.Histogram
- func FromIntHistogram(timestamp int64, h *histogram.Histogram) prompb.Histogram
- func FromMetadataType(t model.MetricType) prompb.MetricMetadata_MetricType
- type Format
- func (s *Format) AddPrometheusMetadata(name string, unit string, help string, pType string) error
- func (s *Format) AddPrometheusMetric(ts int64, value float64, lbls labels.Labels, h *histogram.Histogram, ...) error
- func (s *Format) Marshal(handle func(map[string]string, []byte) error) error
- func (s *Format) Unmarshal(meta map[string]string, buf []byte) (items []types.Datum, err error)
- type Metadata
- func (m Metadata) Bytes() []byte
- func (m Metadata) FileFormat() types.FileFormat
- func (m Metadata) Free()
- func (m Metadata) IsMeta() bool
- func (metadata *Metadata) Marshal(b []byte)
- func (metadata *Metadata) MarshalPlain(tn int, b []byte) (n int)
- func (metadata *Metadata) Size() int
- func (metadata *Metadata) SizePlain() (s int)
- func (m Metadata) Type() types.Type
- func (metadata *Metadata) Unmarshal(b []byte) (n int, err error)
- func (metadata *Metadata) UnmarshalPlain(tn int, b []byte) (n int, err error)
- type Metric
- func (m Metric) Bytes() []byte
- func (m Metric) FileFormat() types.FileFormat
- func (m *Metric) Free()
- func (m Metric) Hash() uint64
- func (m Metric) IsHistogram() bool
- func (metric *Metric) Marshal(b []byte)
- func (metric *Metric) MarshalPlain(tn int, b []byte) (n int)
- func (metric *Metric) Size() int
- func (metric *Metric) SizePlain() (s int)
- func (m Metric) TimeStampMS() int64
- func (m Metric) Type() types.Type
- func (metric *Metric) Unmarshal(b []byte) (n int, err error)
- func (metric *Metric) UnmarshalPlain(tn int, b []byte) (n int, err error)
Constants ¶
View Source
const PrometheusExemplar = uint8(2)
View Source
const PrometheusMetadata = uint8(3)
View Source
const PrometheusMetric = uint8(1)
Variables ¶
This section is empty.
Functions ¶
func FromFloatHistogram ¶
func FromFloatHistogram(timestamp int64, fh *histogram.FloatHistogram) prompb.Histogram
FromFloatHistogram returns remote Histogram from the float Histogram.
func FromIntHistogram ¶
FromIntHistogram returns remote Histogram from the integer Histogram.
func FromMetadataType ¶
func FromMetadataType(t model.MetricType) prompb.MetricMetadata_MetricType
FromMetadataType transforms a Prometheus metricType into prompb metricType. Since the former is a string we need to transform it to an enum.
Types ¶
type Format ¶
type Format struct {
// contains filtered or unexported fields
}
Format describe the v2 data format.
func (*Format) AddPrometheusMetadata ¶
func (*Format) AddPrometheusMetric ¶
func (s *Format) AddPrometheusMetric(ts int64, value float64, lbls labels.Labels, h *histogram.Histogram, fh *histogram.FloatHistogram, externalLabels map[string]string) error
AddPrometheusMetric marshals a prometheus metric to its prombpb.TimeSeries representation and writes it to the buffer.
type Metadata ¶
type Metadata struct {
Buf []byte
}
Struct - Metadata
func (Metadata) FileFormat ¶
func (m Metadata) FileFormat() types.FileFormat
func (*Metadata) MarshalPlain ¶
MarshalPlain - metadata
type Metric ¶
Struct - Metric
func (Metric) Bytes ¶
Bytes represents the underlying data and should not be handled aside from Build* functions that understand the Type.
func (Metric) FileFormat ¶
func (m Metric) FileFormat() types.FileFormat
func (Metric) IsHistogram ¶
func (*Metric) MarshalPlain ¶
MarshalPlain - metric
func (Metric) TimeStampMS ¶
Click to show internal directories.
Click to hide internal directories.