logzio_alerts_client

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogzioGrafanaAlertsClient

type LogzioGrafanaAlertsClient struct {
	AlertManagerGlobalConfig *alert_manager_config.GlobalConfig
	// contains filtered or unexported fields
}

func NewLogzioGrafanaAlertsClient

func NewLogzioGrafanaAlertsClient(logzioApiToken string, logzioApiUrl string, rulesDs string, envId string, ignoreSlackText bool, ignoreSlackTitle bool) *LogzioGrafanaAlertsClient

func (*LogzioGrafanaAlertsClient) DeleteContactPoints

func (l *LogzioGrafanaAlertsClient) DeleteContactPoints(contactPointsToDelete []grafana_contact_points.GrafanaContactPoint)

DeleteContactPoints deletes the contact points from logz.io

func (*LogzioGrafanaAlertsClient) DeleteRules

func (l *LogzioGrafanaAlertsClient) DeleteRules(rulesToDelete []grafana_alerts.GrafanaAlertRule, folderUid string)

DeleteRules deletes the rules from logz.io

func (*LogzioGrafanaAlertsClient) FindOrCreatePrometheusAlertsFolder

func (l *LogzioGrafanaAlertsClient) FindOrCreatePrometheusAlertsFolder() (string, error)

FindOrCreatePrometheusAlertsFolder tries to find the prometheus alerts folder in logz.io, if it does not exist it creates it.

func (*LogzioGrafanaAlertsClient) GetLogzioGrafanaAlerts

func (l *LogzioGrafanaAlertsClient) GetLogzioGrafanaAlerts(folderUid string) ([]grafana_alerts.GrafanaAlertRule, error)

GetLogzioGrafanaAlerts builds a list of rules from all logz.io

func (*LogzioGrafanaAlertsClient) GetLogzioGrafanaNotificationPolicies

func (*LogzioGrafanaAlertsClient) GetLogzioManagedGrafanaContactPoints

func (l *LogzioGrafanaAlertsClient) GetLogzioManagedGrafanaContactPoints() ([]grafana_contact_points.GrafanaContactPoint, error)

func (*LogzioGrafanaAlertsClient) ResetNotificationPolicyTree

func (l *LogzioGrafanaAlertsClient) ResetNotificationPolicyTree() error

func (*LogzioGrafanaAlertsClient) SetNotificationPolicyTreeFromRouteTree

func (l *LogzioGrafanaAlertsClient) SetNotificationPolicyTreeFromRouteTree(routeTree *alert_manager_config.Route)

SetNotificationPolicyTreeFromRouteTree converts route tree to grafana notification policy tree and writes it to logz.io

func (*LogzioGrafanaAlertsClient) UpdateContactPoints

func (l *LogzioGrafanaAlertsClient) UpdateContactPoints(contactPointsToUpdate []alert_manager_config.Receiver, contactPointsMap []grafana_contact_points.GrafanaContactPoint)

UpdateContactPoints updates the contact points in logz.io

func (*LogzioGrafanaAlertsClient) UpdateRules

func (l *LogzioGrafanaAlertsClient) UpdateRules(rulesToUpdate []rulefmt.RuleNode, logzioRulesMap map[string]grafana_alerts.GrafanaAlertRule, folderUid string)

UpdateRules updates the rules in logz.io

func (*LogzioGrafanaAlertsClient) WriteContactPoints

func (l *LogzioGrafanaAlertsClient) WriteContactPoints(contactPointsToWrite []alert_manager_config.Receiver)

WriteContactPoints writes the contact points to logz.io

func (*LogzioGrafanaAlertsClient) WriteRules

func (l *LogzioGrafanaAlertsClient) WriteRules(rulesToWrite []rulefmt.RuleNode, folderUid string)

WriteRules writes the rules to logz.io

type PrometheusQueryModel

type PrometheusQueryModel struct {
	Expr  string `json:"expr"`
	Hide  bool   `json:"hide"`
	RefId string `json:"refId"`
}

PrometheusQueryModel represents a Prometheus query.

func (PrometheusQueryModel) ToJSON

func (p PrometheusQueryModel) ToJSON() (json.RawMessage, error)

ToJSON marshals the Query into a JSON byte slice

type ReduceQueryModel

type ReduceQueryModel struct {
	DataSource map[string]string `json:"datasource"`
	Expression string            `json:"expression"`
	Hide       bool              `json:"hide"`
	RefId      string            `json:"refId"`
	Reducer    string            `json:"reducer"`
	Type       string            `json:"type"`
}

ReduceQueryModel represents a reduce query for time series data

func (ReduceQueryModel) ToJSON

func (r ReduceQueryModel) ToJSON() (json.RawMessage, error)

ToJSON marshals the Query model into a JSON byte slice

Jump to

Keyboard shortcuts

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