prometheus

package
v0.0.0-...-334dc12 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProcessWebhookAlert

func ProcessWebhookAlert(payload io.ReadCloser, mongoClient *mongo.Client) error

Types

type WebhookAlertPayload

type WebhookAlertPayload struct {
	Receiver    string                           `json:"receiver"`
	Alerts      []WebhookAlertPayloadSubInstance `json:"alerts"`
	GroupLabels struct {
		Alertname   string `json:"alertname"`
		App         string `json:"app"`
		Cluster     string `json:"cluster"`
		Container   string `json:"container"`
		Environment string `json:"environment"`
		Namespace   string `json:"namespace"`
		Prometheus  string `json:"prometheus"`
		Severity    string `json:"severity"`
	} `json:"groupLabels"`
	CommonLabels struct {
		Alertname   string `json:"alertname"`
		App         string `json:"app"`
		Cluster     string `json:"cluster"`
		Container   string `json:"container"`
		Environment string `json:"environment"`
		Namespace   string `json:"namespace"`
		Prometheus  string `json:"prometheus"`
		Severity    string `json:"severity"`
	} `json:"commonLabels"`
	CommonAnnotations struct {
		Description string `json:"description"`
		Runbook     string `json:"runbook"`
		Summary     string `json:"summary"`
	} `json:"commonAnnotations"`
	ExternalURL     string `json:"externalURL"`
	Version         string `json:"version"`
	TruncatedAlerts int    `json:"truncatedAlerts"`
}

type WebhookAlertPayloadSubInstance

type WebhookAlertPayloadSubInstance struct {
	Status      string                               `json:"status"`
	Labels      WebhookAlertPayloadSubInstanceLabels `json:"labels"`
	Annotations struct {
		Description string `json:"description"`
		Runbook     string `json:"runbook"`
		Summary     string `json:"summary"`
	} `json:"annotations"`
	StartsAt     time.Time `json:"startsAt"`
	EndsAt       time.Time `json:"endsAt"`
	GeneratorURL string    `json:"generatorURL"`
	Fingerprint  string    `json:"fingerprint"`
}

type WebhookAlertPayloadSubInstanceLabels

type WebhookAlertPayloadSubInstanceLabels struct {
	Alertname   string `json:"alertname"`
	App         string `json:"app"`
	Cluster     string `json:"cluster"`
	Container   string `json:"container"`
	Environment string `json:"environment"`
	Namespace   string `json:"namespace"`
	Prometheus  string `json:"prometheus"`
	Severity    string `json:"severity"`
}

Jump to

Keyboard shortcuts

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