Documentation ¶
Overview ¶
Shared definitions (constants & errors) for opni alerting
Index ¶
- Constants
- Variables
- func BackendDefaultFile(managementUrl string) error
- func DefaultAlertManagerConfig(managementUrl string) (bytes.Buffer, error)
- func LabelWithAlert(label map[string]string) map[string]string
- func WithFailedPreconditionError(msg string) error
- func WithFailedPreconditionErrorf(format string, args ...interface{}) error
- func WithInternalServerError(msg string) error
- func WithInternalServerErrorf(format string, args ...interface{}) error
- func WithNotFoundError(msg string) error
- func WithNotFoundErrorf(format string, args ...interface{}) error
- func WithUnimplementedError(msg string) error
- func WithUnimplementedErrorf(format string, args ...interface{}) error
- type AlertingOptions
- type DefaultAlertManagerInfo
- type FailedPreconditionError
- type InternalServerError
- type NewAlertingOptions
- type NotFoundError
- type UnimplementedError
Constants ¶
View Source
const ( AlertingV1Alpha = "v1alpha" MonitoringDatasource = "monitoring" LoggingDatasource = "logging" SystemDatasource = "system" )
View Source
const ( ConfigMountPath = "/etc/config" DataMountPath = "/var/lib/alertmanager/data" AlertManagerConfigKey = "alertmanager.yaml" InternalRoutingConfigKey = "internal-routing.yaml" OperatorAlertingControllerServiceName = "opni-alerting-controller" OperatorAlertingClusterNodeServiceName = "opni-alerting" AlertingHookReceiverName = "opni.hook" AlertingDefaultHookName = "/opni/hook" AlertingDefaultHookPort = 3000 )
View Source
const ( // global streams AgentClusterHealthStatusStream = "agent-cluster-health-status" AgentClusterHealthStatusSubjects = "agent-cluster-health-status.*" AgentClusterHealthStatusDurableReplay = "agent-cluster-health-status-consumer" //streams AgentDisconnectStream = "opni_alerting_agent" AgentDisconnectStreamSubjects = "opni_alerting_agent.*" AgentHealthStream = "opni_alerting_health" AgentHealthStreamSubjects = "opni_alerting_health.*" CortexStatusStream = "opni_alerting_cortex_status" CortexStatusStreamSubjects = "opni_alerting_cortex_status.*" // buckets AgentDisconnectBucket = "opni-alerting-agent-bucket" AgentStatusBucket = "opni-alerting-agent-status-bucket" StatusBucketPerCondition = "opni-alerting-condition-status-bucket" StatusBucketPerClusterInternalType = "opni-alerting-cluster-condition-type-status-bucket" GeneralIncidentStorage = "opni-alerting-general-incident-bucket" )
Jetstream streams
View Source
const AgentDisconnectStorageType = "agent-disconnect"
View Source
const BackendConditionClusterIdLabel = "clusterId"
View Source
const BackendConditionIdLabel = "conditionId"
labels
View Source
const BackendConditionNameLabel = "opniname"
View Source
const BackendConditionSeverityLabel = "severity"
View Source
const CortexCompactor = "compactor"
View Source
const CortexDistributor = "distributor"
View Source
const CortexIngester = "ingester"
View Source
const CortexPurger = "purger"
View Source
const CortexQuerier = "querier"
View Source
const CortexQueryFrontend = "query-frontend"
View Source
const CortexRuler = "ruler"
View Source
const CortexStoreGateway = "store-gateway"
View Source
const LocalAlertManagerPath = "/tmp/alertmanager.yaml"
View Source
const LocalBackendEnvToggle = "OPNI_ALERTING_BACKEND_LOCAL"
Variables ¶
View Source
var ( PublicLabels = map[string]string{} PublicServiceLabels = map[string]string{} )
View Source
var ( AlertingErrNotImplemented = WithUnimplementedError("Not implemented") AlertingErrNotImplementedNOOP = WithUnimplementedError("Alerting NOOP : Not implemented") AlertingErrParseBucket = WithInternalServerError("Failed to parse bucket index") AlertingErrBucketIndexInvalid = WithInternalServerError("Bucket index is invalid") AlertingErrInvalidSlackChannel = validation.Error("Slack channel invalid : must start with '#'") AlertingErrK8sRuntime = WithInternalServerError("K8s Runtime error") AlertingErrMismatchedImplementation = validation.Error("Alerting endpoint did not match the given implementation") )
View Source
var ComparisonOperators = []string{"<", ">", "<=", ">=", "=", "!="}
Condition constants
View Source
var CortexComponents = []string{ CortexDistributor, CortexIngester, CortexRuler, CortexPurger, CortexCompactor, CortexStoreGateway, CortexQueryFrontend, CortexQuerier, }
View Source
var DefaultAlertManager = template.Must(template.New("DefaultManagementHook").Parse(strings.Join([]string{ strings.TrimSpace(route), receivers, strings.TrimSpace(inihibit_rules), }, "\n")))
View Source
var KubeStates = []string{"Pending", "Running", "Succeeded", "Failed", "Unknown"}
Functions ¶
func BackendDefaultFile ¶ added in v0.6.0
func DefaultAlertManagerConfig ¶ added in v0.6.1
func LabelWithAlert ¶ added in v0.6.0
func WithFailedPreconditionError ¶ added in v0.7.0
func WithFailedPreconditionErrorf ¶ added in v0.7.0
func WithInternalServerError ¶ added in v0.6.0
func WithInternalServerErrorf ¶ added in v0.6.0
func WithNotFoundError ¶ added in v0.6.0
func WithNotFoundErrorf ¶ added in v0.6.0
func WithUnimplementedError ¶
func WithUnimplementedErrorf ¶
Types ¶
type AlertingOptions ¶ added in v0.6.0
type DefaultAlertManagerInfo ¶ added in v0.6.0
type FailedPreconditionError ¶ added in v0.7.0
type FailedPreconditionError struct {
// contains filtered or unexported fields
}
func (*FailedPreconditionError) Error ¶ added in v0.7.0
func (e *FailedPreconditionError) Error() string
func (*FailedPreconditionError) GRPCStatus ¶ added in v0.7.0
func (e *FailedPreconditionError) GRPCStatus() *status.Status
type InternalServerError ¶ added in v0.6.0
type InternalServerError struct {
// contains filtered or unexported fields
}
func (*InternalServerError) Error ¶ added in v0.6.0
func (e *InternalServerError) Error() string
func (*InternalServerError) GRPCStatus ¶ added in v0.6.0
func (e *InternalServerError) GRPCStatus() *status.Status
type NewAlertingOptions ¶ added in v0.6.0
type NewAlertingOptions struct { Namespace string WorkerNodesService string WorkerNodePort int WorkerStatefulSet string ControllerNodeService string ControllerNodePort int ControllerClusterPort int ControllerStatefulSet string ConfigMap string ManagementHookHandler string }
func (*NewAlertingOptions) GetControllerEndpoint ¶ added in v0.6.0
func (a *NewAlertingOptions) GetControllerEndpoint() string
func (*NewAlertingOptions) GetInternalControllerOpniEndpoint ¶ added in v0.7.0
func (a *NewAlertingOptions) GetInternalControllerOpniEndpoint() string
func (*NewAlertingOptions) GetInternalWorkerOpniEndpoint ¶ added in v0.7.0
func (a *NewAlertingOptions) GetInternalWorkerOpniEndpoint() string
func (*NewAlertingOptions) GetWorkerEndpoint ¶ added in v0.6.0
func (a *NewAlertingOptions) GetWorkerEndpoint() string
type NotFoundError ¶ added in v0.6.0
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Error ¶ added in v0.6.0
func (e *NotFoundError) Error() string
func (*NotFoundError) GRPCStatus ¶ added in v0.6.0
func (e *NotFoundError) GRPCStatus() *status.Status
type UnimplementedError ¶
type UnimplementedError struct {
// contains filtered or unexported fields
}
func (*UnimplementedError) Error ¶
func (e *UnimplementedError) Error() string
func (*UnimplementedError) GRPCStatus ¶
func (e *UnimplementedError) GRPCStatus() *status.Status
Click to show internal directories.
Click to hide internal directories.