Documentation ¶
Overview ¶
Package staticmetrics ...
Index ¶
- func DefaultLabelSetFunc(series *prompb.TimeSeries) []storepb.Label
- func DefaultUpdateSeriesFunc(series *prompb.TimeSeries) *prompb.TimeSeries
- type LabelSetFunc
- type StaticMetricsStore
- func (s *StaticMetricsStore) GetMatcherSeries(rawSeries []*prompb.TimeSeries, matchers []*labels.Matcher, minTime int64, ...) []*prompb.TimeSeries
- func (s *StaticMetricsStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error)
- func (s *StaticMetricsStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error)
- func (s *StaticMetricsStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequest) (*storepb.LabelValuesResponse, error)
- func (s *StaticMetricsStore) SendSeries(series *prompb.TimeSeries, srv storepb.Store_SeriesServer, ...) error
- func (s *StaticMetricsStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
- type UpdateSeriesFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultLabelSetFunc ¶
func DefaultLabelSetFunc(series *prompb.TimeSeries) []storepb.Label
DefaultLabelSetFunc 默认原样返回
func DefaultUpdateSeriesFunc ¶
func DefaultUpdateSeriesFunc(series *prompb.TimeSeries) *prompb.TimeSeries
DefaultUpdateSeriesFunc 默认原因返回
Types ¶
type LabelSetFunc ¶
type LabelSetFunc func(series *prompb.TimeSeries) []storepb.Label
LabelSetFunc 发送数据时, 转换labels函数
func MakeLabelSetFuncByName ¶
func MakeLabelSetFuncByName(metricName string) LabelSetFunc
MakeLabelSetFuncByName labels 中添加 __name__ label
type StaticMetricsStore ¶
type StaticMetricsStore struct { Reg *prometheus.Registry ExternalLabels labels.Labels OutageTolerance time.Duration MetricNames []string }
StaticMetricsStore 只提供有限 metrics store
func (*StaticMetricsStore) GetMatcherSeries ¶
func (s *StaticMetricsStore) GetMatcherSeries(rawSeries []*prompb.TimeSeries, matchers []*labels.Matcher, minTime int64, maxTime int64) []*prompb.TimeSeries
GetMatcherSeries : 获取 匹配的 series
func (*StaticMetricsStore) Info ¶
func (s *StaticMetricsStore) Info(_ context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error)
Info 实现方法
func (*StaticMetricsStore) LabelNames ¶
func (s *StaticMetricsStore) LabelNames(ctx context.Context, r *storepb.LabelNamesRequest) (*storepb.LabelNamesResponse, error)
LabelNames 只返回__name__
func (*StaticMetricsStore) LabelValues ¶
func (s *StaticMetricsStore) LabelValues(ctx context.Context, r *storepb.LabelValuesRequest) ( *storepb.LabelValuesResponse, error)
LabelValues 只返回metrics names
func (*StaticMetricsStore) SendSeries ¶
func (s *StaticMetricsStore) SendSeries( series *prompb.TimeSeries, srv storepb.Store_SeriesServer, updateSeriesFunc UpdateSeriesFunc, labelSetFunc LabelSetFunc, ) error
SendSeries : 给 metricName 发送数据(流)
func (*StaticMetricsStore) Series ¶
func (s *StaticMetricsStore) Series(r *storepb.SeriesRequest, srv storepb.Store_SeriesServer) error
Series 需要继承函数实现
type UpdateSeriesFunc ¶
type UpdateSeriesFunc func(series *prompb.TimeSeries) *prompb.TimeSeries
UpdateSeriesFunc 发送数据时, 转换数据函数
Click to show internal directories.
Click to hide internal directories.