helpers

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdjustStep

func AdjustStep(start, stop, maxPointsPerQuery, minStep int64, forceMinStepInterval time.Duration) int64

AdjustStep adjusts step keeping in mind default/configurable limit of maximum points per query Steps sequence is aligned with Grafana. Step progresses in the following order: minimal configured step if not default => 20 => 30 => 60 => 120 => 300 => 600 => 900 => 1200 => 1800 => 3600 => 7200 => 10800 => 21600 => 43200 => 86400

func AlignValues

func AlignValues(startTime, stopTime, step int64, promValues []types.Value) []float64

AlignValues inserts math.NaN() in place of gaps in data from Prometheus

func ConvertGraphiteTargetToPromQL

func ConvertGraphiteTargetToPromQL(query string) string

ConvertGraphiteTargetToPromQL - converts graphite target string to PromQL friendly format

func PromMetricToGraphite

func PromMetricToGraphite(metric map[string]string) string

PromMetricToGraphite converts prometheus metric name to a format expected by graphite

func PromethizeTagValue

func PromethizeTagValue(tagValue string) (string, types.Tag)

PromethizeTagValue - accept 'Tag=value' or 'Tag=~value' string and return sanitized version of it

func SeriesByTagToPromQL

func SeriesByTagToPromQL(step, target string) (string, string)

SeriesByTagToPromQL converts graphite SeriesByTag to PromQL will return step if __step__ is passed

func SplitTagValues

func SplitTagValues(query string) map[string]types.Tag

SplitTagValues - For given tag-value list converts it to more usable map[string]Tag, where string is TagName

Types

This section is empty.

Jump to

Keyboard shortcuts

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