Documentation
¶
Index ¶
- Constants
- Variables
- func GetClusterClient(clusterName string, platformClient platformversionedclient.PlatformV1Interface) (kubernetes.Interface, error)
- func GetMonitoringClient(clusterName string, platformClient platformversionedclient.PlatformV1Interface) (monitoringclient.Interface, error)
- func ParseES(esStr string) (esclient.Client, error)
- func ParseInfluxdb(influxdbStr string) (influxclient.Client, error)
- func RenameInfluxDB(name string) string
- func ValidateLabels(labels map[string]string) error
- type GenericRouteOperator
- type GenericRuleOperator
- type PersistentOperator
- type RouteOperator
- type RuleGroupOperator
- type RuleOperator
Constants ¶
const (
// DefaultAlertKey defines the default key for prometheus and alertmanager labels
DefaultAlertKey = "alert"
)
const (
// ProjectDatabaseName defines database name for project metrics
ProjectDatabaseName = "projects"
)
Variables ¶
var ClusterNameToClient sync.Map
ClusterNameToClient mapping cluster to kubernetes client clusterName => kubernetes.Interface
var ClusterNameToMonitor sync.Map
ClusterNameToMonitor mapping cluster to monitoring client clusterName => monitoringclient.Clientset
Functions ¶
func GetClusterClient ¶
func GetClusterClient(clusterName string, platformClient platformversionedclient.PlatformV1Interface) (kubernetes.Interface, error)
GetClusterClient get kubernetes client via cluster name
func GetMonitoringClient ¶
func GetMonitoringClient(clusterName string, platformClient platformversionedclient.PlatformV1Interface) (monitoringclient.Interface, error)
GetMonitoringClient get monitoring client via cluster name
func ParseInfluxdb ¶
func ParseInfluxdb(influxdbStr string) (influxclient.Client, error)
ParseInfluxdb parse influxdb address and pwd
func RenameInfluxDB ¶
RenameInfluxDB replace invalid character for influxDB database
func ValidateLabels ¶
ValidateLabels returns if labels has default key, if not return error
Types ¶
type GenericRouteOperator ¶
type GenericRouteOperator interface { RouteOperator PersistentOperator }
GenericRouteOperator defines the generic alert route for alertmanager
type GenericRuleOperator ¶
type GenericRuleOperator interface { RuleOperator RuleGroupOperator PersistentOperator LoadPromRule([]v1.RuleGroup) error SavePromRule() []v1.RuleGroup }
GenericRuleOperator defines the generic rule operator for prometheus
type PersistentOperator ¶
PersistentOperator defined the persistent method of rule operator
type RouteOperator ¶
type RouteOperator interface { InsertRoute(route *alert_config.Route) (*alert_config.Route, error) DeleteRoute(alertValue string) (*alert_config.Route, error) UpdateRoute(alertValue string, route *alert_config.Route) (*alert_config.Route, error) GetRoute(alertValue string) (*alert_config.Route, error) ListRoute() ([]*alert_config.Route, error) }
RouteOperator defines the CRUD interface of alert route
type RuleGroupOperator ¶
type RuleGroupOperator interface { InsertRuleGroup(group *v1.RuleGroup) (int, *v1.RuleGroup, error) DeleteRuleGroup(groupName string) (*v1.RuleGroup, error) UpdateRuleGroup(groupName string, rev int, group *v1.RuleGroup) (int, *v1.RuleGroup, error) GetRuleGroup(groupName string) (int, *v1.RuleGroup, error) ListGroup() ([]*v1.RuleGroup, error) }
RuleGroupOperator defines the CRUD interface of rule group operator
type RuleOperator ¶
type RuleOperator interface { InsertRule(groupName string, rule *v1.Rule) (int, *v1.Rule, error) DeleteRule(groupName, recordName string) (*v1.Rule, error) UpdateRule(groupName, recordName string, rev int, rule *v1.Rule) (int, *v1.Rule, error) GetRule(groupName, recordName string) (int, *v1.Rule, error) ListRule(groupName string) ([]*v1.Rule, error) }
RuleOperator defines the CRUD interface of rule record operator