Documentation ¶
Overview ¶
Package monitoring provides various utility functions regarding monitoring for the sf-operator:
* create prometheus monitors and alert rules * create nodeexporter sidecar * create statsdexporter sidecar
Index ¶
- Constants
- Variables
- func GetStatsdExporterPort(serviceName string) string
- func GetTruncatedPortName(serviceName string, suffix string) string
- func MkAlertRuleChecksumString(alertRule monitoringv1.Rule) string
- func MkDiskUsagePromRule(ruleGroups []monitoringv1.RuleGroup, ns string) monitoringv1.PrometheusRule
- func MkDiskUsageRuleGroup(ns string, componentIdent string) monitoringv1.RuleGroup
- func MkNodeExporterSideCarContainer(serviceName string, volumeMounts []apiv1.VolumeMount) apiv1.Container
- func MkPodMonitor(name string, ns string, ports []string, selector metav1.LabelSelector) monitoringv1.PodMonitor
- func MkPrometheusAlertRule(name string, expr intstr.IntOrString, forDuration string, ...) monitoringv1.Rule
- func MkPrometheusRuleCR(name string, ns string) monitoringv1.PrometheusRule
- func MkPrometheusRuleGroup(name string, rules []monitoringv1.Rule) monitoringv1.RuleGroup
- func MkStatsdExporterSideCarContainer(serviceName string, configVolumeName string, relayAddress *string) apiv1.Container
- type StatsdMetricMapping
- type StatsdMetricMappingLabel
Constants ¶
View Source
const NodeExporterNameSuffix = "-nodeexporter"
View Source
const NodeExporterPort = 9100
View Source
const NodeExporterPortNameSuffix = "-ne"
View Source
const ServiceMonitorLabelSelector = "sf-monitoring"
ServiceMonitorLabelSelector - TODO this could be a spec parameter.
View Source
const StatsdExporterConfigFile = "statsd_mapping.yaml"
View Source
const StatsdExporterPortListen = int32(9125)
Variables ¶
View Source
var CriticalSeverityLabel = map[string]string{
"severity": "critical",
}
View Source
var WarningSeverityLabel = map[string]string{
"severity": "warning",
}
Functions ¶
func GetStatsdExporterPort ¶
func GetTruncatedPortName ¶
func MkAlertRuleChecksumString ¶
func MkAlertRuleChecksumString(alertRule monitoringv1.Rule) string
func MkDiskUsagePromRule ¶
func MkDiskUsagePromRule(ruleGroups []monitoringv1.RuleGroup, ns string) monitoringv1.PrometheusRule
func MkDiskUsageRuleGroup ¶
func MkDiskUsageRuleGroup(ns string, componentIdent string) monitoringv1.RuleGroup
func MkNodeExporterSideCarContainer ¶
func MkNodeExporterSideCarContainer(serviceName string, volumeMounts []apiv1.VolumeMount) apiv1.Container
func MkPodMonitor ¶
func MkPodMonitor(name string, ns string, ports []string, selector metav1.LabelSelector) monitoringv1.PodMonitor
func MkPrometheusAlertRule ¶
func MkPrometheusAlertRule(name string, expr intstr.IntOrString, forDuration string, labels map[string]string, annotations map[string]string) monitoringv1.Rule
func MkPrometheusRuleCR ¶
func MkPrometheusRuleCR(name string, ns string) monitoringv1.PrometheusRule
func MkPrometheusRuleGroup ¶
func MkPrometheusRuleGroup(name string, rules []monitoringv1.Rule) monitoringv1.RuleGroup
Types ¶
type StatsdMetricMapping ¶
type StatsdMetricMapping struct { Name string ProviderName string Match string Help string Labels []StatsdMetricMappingLabel }
func MkStatsdMappingsFromCloudsYaml ¶
func MkStatsdMappingsFromCloudsYaml(extraMappings []StatsdMetricMapping, cloudsYaml map[string]interface{}) []StatsdMetricMapping
Click to show internal directories.
Click to hide internal directories.