monitoring

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

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

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 GetStatsdExporterPort(serviceName string) string

func GetTruncatedPortName

func GetTruncatedPortName(serviceName string, suffix string) string

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

func MkStatsdExporterSideCarContainer

func MkStatsdExporterSideCarContainer(serviceName string, configVolumeName string, relayAddress *string) apiv1.Container

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

type StatsdMetricMappingLabel

type StatsdMetricMappingLabel struct {
	LabelName  string
	LabelValue string
}

Jump to

Keyboard shortcuts

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