Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Metrics. PromSLIErrorMetricFmt = "slo:sli_error:ratio_rate%s" // Labels. PromSLONameLabelName = "sloth_slo" PromSLOIDLabelName = "sloth_id" PromSLOServiceLabelName = "sloth_service" PromSLOWindowLabelName = "sloth_window" PromSLOSeverityLabelName = "sloth_severity" PromSLOVersionLabelName = "sloth_version" PromSLOModeLabelName = "sloth_mode" PromSLOSpecLabelName = "sloth_spec" PromSLOObjectiveLabelName = "sloth_objective" )
Prometheus metrics conventions.
Variables ¶
View Source
var ( // NameRegexp is the regex to validate SLO, SLI and in general safe names and IDs. // Names must: // - Start and end with an alphanumeric. // - Contain alphanumeric, `.`, '_', and '-'. NameRegexp = regexp.MustCompile(`^[A-Za-z0-9][-A-Za-z0-9_.]*[A-Za-z0-9]$`) // TplWindowRegex is the regex to match the {{ .window }} template variable. TplWindowRegex = regexp.MustCompile(`{{ *\.window *}}`) )
Functions ¶
func GetSLIErrorMetric ¶
GetSLIErrorMetric returns the SLI error Prometheus metric name.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.