Documentation
¶
Index ¶
- Constants
- type AlertmanagerAlert
- type AlertmanagerWebhookPayload
- type Client
- type Configuration
- type GetAlert
- func (c *GetAlert) Actions() []core.Action
- func (c *GetAlert) Cancel(ctx core.ExecutionContext) error
- func (c *GetAlert) Cleanup(ctx core.SetupContext) error
- func (c *GetAlert) Color() string
- func (c *GetAlert) Configuration() []configuration.Field
- func (c *GetAlert) Description() string
- func (c *GetAlert) Documentation() string
- func (c *GetAlert) ExampleOutput() map[string]any
- func (c *GetAlert) Execute(ctx core.ExecutionContext) error
- func (c *GetAlert) HandleAction(ctx core.ActionContext) error
- func (c *GetAlert) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (c *GetAlert) Icon() string
- func (c *GetAlert) Label() string
- func (c *GetAlert) Name() string
- func (c *GetAlert) OutputChannels(configuration any) []core.OutputChannel
- func (c *GetAlert) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *GetAlert) Setup(ctx core.SetupContext) error
- type GetAlertConfiguration
- type Metadata
- type OnAlert
- func (t *OnAlert) Actions() []core.Action
- func (t *OnAlert) Cleanup(ctx core.TriggerContext) error
- func (t *OnAlert) Color() string
- func (t *OnAlert) Configuration() []configuration.Field
- func (t *OnAlert) Description() string
- func (t *OnAlert) Documentation() string
- func (t *OnAlert) ExampleData() map[string]any
- func (t *OnAlert) HandleAction(ctx core.TriggerActionContext) (map[string]any, error)
- func (t *OnAlert) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (t *OnAlert) Icon() string
- func (t *OnAlert) Label() string
- func (t *OnAlert) Name() string
- func (t *OnAlert) Setup(ctx core.TriggerContext) error
- type OnAlertConfiguration
- type OnAlertMetadata
- type Prometheus
- func (p *Prometheus) Actions() []core.Action
- func (p *Prometheus) Cleanup(ctx core.IntegrationCleanupContext) error
- func (p *Prometheus) Components() []core.Component
- func (p *Prometheus) Configuration() []configuration.Field
- func (p *Prometheus) Description() string
- func (p *Prometheus) HandleAction(ctx core.IntegrationActionContext) error
- func (p *Prometheus) HandleRequest(ctx core.HTTPRequestContext)
- func (p *Prometheus) Icon() string
- func (p *Prometheus) Instructions() string
- func (p *Prometheus) Label() string
- func (p *Prometheus) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
- func (p *Prometheus) Name() string
- func (p *Prometheus) Sync(ctx core.SyncContext) error
- func (p *Prometheus) Triggers() []core.Trigger
- type PrometheusAlert
- type PrometheusAlertsData
- type PrometheusWebhookHandler
- func (h *PrometheusWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
- func (h *PrometheusWebhookHandler) CompareConfig(a any, b any) (bool, error)
- func (h *PrometheusWebhookHandler) Merge(current, requested any) (any, bool, error)
- func (h *PrometheusWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
Constants ¶
View Source
const ( AuthTypeNone = "none" AuthTypeBasic = "basic" AuthTypeBearer = "bearer" AlertStateAny = "any" AlertStateFiring = "firing" AlertStateResolved = "resolved" AlertStatePending = "pending" AlertStateInactive = "inactive" PrometheusAlertPayloadType = "prometheus.alert" )
View Source
const MaxResponseSize = 1 * 1024 * 1024 // 1MB
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertmanagerAlert ¶
type AlertmanagerAlert struct {
Status string `json:"status"`
Labels map[string]string `json:"labels"`
Annotations map[string]string `json:"annotations"`
StartsAt string `json:"startsAt"`
EndsAt string `json:"endsAt"`
GeneratorURL string `json:"generatorURL"`
Fingerprint string `json:"fingerprint"`
}
type AlertmanagerWebhookPayload ¶
type AlertmanagerWebhookPayload struct {
Version string `json:"version"`
GroupKey string `json:"groupKey"`
Status string `json:"status"`
Receiver string `json:"receiver"`
GroupLabels map[string]string `json:"groupLabels"`
CommonLabels map[string]string `json:"commonLabels"`
CommonAnnotations map[string]string `json:"commonAnnotations"`
ExternalURL string `json:"externalURL"`
TruncatedAlerts int `json:"truncatedAlerts"`
Alerts []AlertmanagerAlert `json:"alerts"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(httpContext core.HTTPContext, integration core.IntegrationContext) (*Client, error)
func (*Client) GetAlertsFromPrometheus ¶
func (c *Client) GetAlertsFromPrometheus() ([]PrometheusAlert, error)
type Configuration ¶
type Configuration struct {
BaseURL string `json:"baseURL" mapstructure:"baseURL"`
AuthType string `json:"authType" mapstructure:"authType"`
Username string `json:"username,omitempty" mapstructure:"username"`
Password string `json:"password,omitempty" mapstructure:"password"`
BearerToken string `json:"bearerToken,omitempty" mapstructure:"bearerToken"`
WebhookBearerToken string `json:"webhookBearerToken,omitempty" mapstructure:"webhookBearerToken"`
}
type GetAlert ¶
type GetAlert struct{}
func (*GetAlert) Configuration ¶
func (c *GetAlert) Configuration() []configuration.Field
func (*GetAlert) Description ¶
func (*GetAlert) Documentation ¶
func (*GetAlert) ExampleOutput ¶
func (*GetAlert) HandleAction ¶
func (c *GetAlert) HandleAction(ctx core.ActionContext) error
func (*GetAlert) HandleWebhook ¶
func (c *GetAlert) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*GetAlert) OutputChannels ¶
func (c *GetAlert) OutputChannels(configuration any) []core.OutputChannel
func (*GetAlert) ProcessQueueItem ¶
type GetAlertConfiguration ¶
type OnAlert ¶
type OnAlert struct{}
func (*OnAlert) Configuration ¶
func (t *OnAlert) Configuration() []configuration.Field
func (*OnAlert) Description ¶
func (*OnAlert) Documentation ¶
func (*OnAlert) ExampleData ¶
func (*OnAlert) HandleAction ¶
func (*OnAlert) HandleWebhook ¶
func (t *OnAlert) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
type OnAlertConfiguration ¶
type OnAlertMetadata ¶
type Prometheus ¶
type Prometheus struct{}
func (*Prometheus) Actions ¶
func (p *Prometheus) Actions() []core.Action
func (*Prometheus) Cleanup ¶
func (p *Prometheus) Cleanup(ctx core.IntegrationCleanupContext) error
func (*Prometheus) Components ¶
func (p *Prometheus) Components() []core.Component
func (*Prometheus) Configuration ¶
func (p *Prometheus) Configuration() []configuration.Field
func (*Prometheus) Description ¶
func (p *Prometheus) Description() string
func (*Prometheus) HandleAction ¶
func (p *Prometheus) HandleAction(ctx core.IntegrationActionContext) error
func (*Prometheus) HandleRequest ¶
func (p *Prometheus) HandleRequest(ctx core.HTTPRequestContext)
func (*Prometheus) Icon ¶
func (p *Prometheus) Icon() string
func (*Prometheus) Instructions ¶
func (p *Prometheus) Instructions() string
func (*Prometheus) Label ¶
func (p *Prometheus) Label() string
func (*Prometheus) ListResources ¶
func (p *Prometheus) ListResources(resourceType string, ctx core.ListResourcesContext) ([]core.IntegrationResource, error)
func (*Prometheus) Name ¶
func (p *Prometheus) Name() string
func (*Prometheus) Sync ¶
func (p *Prometheus) Sync(ctx core.SyncContext) error
func (*Prometheus) Triggers ¶
func (p *Prometheus) Triggers() []core.Trigger
type PrometheusAlert ¶
type PrometheusAlertsData ¶
type PrometheusAlertsData struct {
Alerts []PrometheusAlert `json:"alerts"`
}
type PrometheusWebhookHandler ¶
type PrometheusWebhookHandler struct{}
func (*PrometheusWebhookHandler) Cleanup ¶
func (h *PrometheusWebhookHandler) Cleanup(ctx core.WebhookHandlerContext) error
func (*PrometheusWebhookHandler) CompareConfig ¶
func (h *PrometheusWebhookHandler) CompareConfig(a any, b any) (bool, error)
func (*PrometheusWebhookHandler) Merge ¶
func (h *PrometheusWebhookHandler) Merge(current, requested any) (any, bool, error)
func (*PrometheusWebhookHandler) Setup ¶
func (h *PrometheusWebhookHandler) Setup(ctx core.WebhookHandlerContext) (any, error)
Click to show internal directories.
Click to hide internal directories.