staticmetrics

package
v0.0.0-...-c91c74a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package staticmetrics ...

Index

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

Info 实现方法

func (*StaticMetricsStore) LabelNames

LabelNames 只返回__name__

func (*StaticMetricsStore) LabelValues

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

Series 需要继承函数实现

type UpdateSeriesFunc

type UpdateSeriesFunc func(series *prompb.TimeSeries) *prompb.TimeSeries

UpdateSeriesFunc 发送数据时, 转换数据函数

Jump to

Keyboard shortcuts

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