Documentation
¶
Index ¶
Constants ¶
View Source
const ( PromRuleGroupNameSLOSLIPrefix = "sloth-slo-sli-recordings-" PromRuleGroupNameSLOMetadataPrefix = "sloth-slo-meta-recordings-" PromRuleGroupNameSLOAlertsPrefix = "sloth-slo-alerts-" PromRuleGroupNameSLOExtraRulesPrefix = "sloth-slo-extra-rules-" )
View Source
const ( // Metrics SLI. PromSLIErrorMetric = "slo:sli_error:ratio_rate" PromSLIErrorMetricFmt = PromSLIErrorMetric + "%s" // Metrics meta. PromMetaSLOObjectiveRatioMetric = "slo:objective:ratio" PromMetaSLOErrorBudgetRatioMetric = "slo:error_budget:ratio" PromMetaSLOTimePeriodDaysMetric = "slo:time_period:days" PromMetaSLOCurrentBurnRateRatioMetric = "slo:current_burn_rate:ratio" PromMetaSLOPeriodBurnRateRatioMetric = "slo:period_burn_rate:ratio" PromMetaSLOPeriodErrorBudgetRemainingRatioMetric = "slo:period_error_budget_remaining:ratio" PromMetaSLOInfoMetric = "sloth_slo_info" // 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 '-'. NameRegexpStr = `^[A-Za-z0-9][-A-Za-z0-9_.]*[A-Za-z0-9]$` NameRegexp = regexp.MustCompile(NameRegexpStr) // TplSLIQueryWindowVarRegex is the regex to match the {{ .window }} template variable used in the SLI queries. TplSLIQueryWindowVarRegex = regexp.MustCompile(`{{ *\.window *}}`) // TplSLIQueryWindowVarName is the name of the window template variable used in the SLI queries. TplSLIQueryWindowVarName = "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.