Documentation ¶
Index ¶
- func CheckStreamAggrConfig() error
- func InitStreamAggr()
- func MustStopStreamAggr()
- func PutInsertCtx(ctx *InsertCtx)
- func StartIngestionRateLimiter(maxIngestionRate int)
- func StopIngestionRateLimiter()
- type InsertCtx
- func (ctx *InsertCtx) AddLabel(name, value string)
- func (ctx *InsertCtx) AddLabelBytes(name, value []byte)
- func (ctx *InsertCtx) ApplyRelabeling()
- func (ctx *InsertCtx) FlushBufs() error
- func (ctx *InsertCtx) Reset(rowsLen int)
- func (ctx *InsertCtx) SortLabelsIfNeeded()
- func (ctx *InsertCtx) TryPrepareLabels(hasRelabeling bool) bool
- func (ctx *InsertCtx) WriteDataPoint(prefix []byte, labels []prompbmarshal.Label, timestamp int64, value float64) error
- func (ctx *InsertCtx) WriteDataPointExt(metricNameRaw []byte, labels []prompbmarshal.Label, timestamp int64, ...) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckStreamAggrConfig ¶ added in v1.90.0
func CheckStreamAggrConfig() error
CheckStreamAggrConfig checks config pointed by -stramaggr.config
func InitStreamAggr ¶ added in v1.86.0
func InitStreamAggr()
InitStreamAggr must be called after flag.Parse and before using the common package.
MustStopStreamAggr must be called when stream aggr is no longer needed.
func MustStopStreamAggr ¶ added in v1.86.0
func MustStopStreamAggr()
MustStopStreamAggr stops stream aggregators.
func PutInsertCtx ¶ added in v1.34.0
func PutInsertCtx(ctx *InsertCtx)
PutInsertCtx returns ctx to the pool.
ctx cannot be used after the call.
func StartIngestionRateLimiter ¶ added in v1.97.15
func StartIngestionRateLimiter(maxIngestionRate int)
StartIngestionRateLimiter starts ingestion rate limiter.
Ingestion rate limiter must be started before Init() call.
StopIngestionRateLimiter must be called before Stop() call in order to unblock all the callers to ingestion rate limiter. Otherwise deadlock may occur at Stop() call.
func StopIngestionRateLimiter ¶ added in v1.97.15
func StopIngestionRateLimiter()
StopIngestionRateLimiter stops ingestion rate limiter.
Types ¶
type InsertCtx ¶
type InsertCtx struct { Labels sortedLabels // contains filtered or unexported fields }
InsertCtx contains common bits for data points insertion.
func GetInsertCtx ¶ added in v1.34.0
func GetInsertCtx() *InsertCtx
GetInsertCtx returns InsertCtx from the pool.
Call PutInsertCtx for returning it to the pool.
func (*InsertCtx) AddLabel ¶
AddLabel adds (name, value) label to ctx.Labels.
name and value must exist until ctx.Labels is used.
func (*InsertCtx) AddLabelBytes ¶ added in v1.30.6
AddLabelBytes adds (name, value) label to ctx.Labels.
name and value must exist until ctx.Labels is used.
func (*InsertCtx) ApplyRelabeling ¶ added in v1.38.0
func (ctx *InsertCtx) ApplyRelabeling()
ApplyRelabeling applies relabeling to ic.Labels.
func (*InsertCtx) SortLabelsIfNeeded ¶ added in v1.58.0
func (ctx *InsertCtx) SortLabelsIfNeeded()
SortLabelsIfNeeded sorts labels if -sortLabels command-line flag is set
func (*InsertCtx) TryPrepareLabels ¶ added in v1.97.14
TryPrepareLabels prepares context labels to the ingestion
It returns false if timeseries should be skipped
func (*InsertCtx) WriteDataPoint ¶
func (ctx *InsertCtx) WriteDataPoint(prefix []byte, labels []prompbmarshal.Label, timestamp int64, value float64) error
WriteDataPoint writes (timestamp, value) with the given prefix and labels into ctx buffer.
caller should invoke TryPrepareLabels before using this function if needed
func (*InsertCtx) WriteDataPointExt ¶
func (ctx *InsertCtx) WriteDataPointExt(metricNameRaw []byte, labels []prompbmarshal.Label, timestamp int64, value float64) ([]byte, error)
WriteDataPointExt writes (timestamp, value) with the given metricNameRaw and labels into ctx buffer.
caller must invoke TryPrepareLabels before using this function
It returns metricNameRaw for the given labels if len(metricNameRaw) == 0.