exporters

package
v0.0.15 Latest Latest
Warning

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

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

README

KubeCope exporters package

This package contains the exporters for the KubeCope project.

Exporters

The following exporters are available:

Alertmanager

The Alertmanager exporter is used to send alerts to the Alertmanager. The Alertmanager will then send the alerts to the configured receivers. To enable the Alertmanager exporter, set the following environment variables:

  • ALERTMANAGER_URL: The URL of the Alertmanager. Example: localhost:9093
STD OUT

The STD OUT exporter is used to print the alerts to the standard output. This exporter is enabled by default. To disable the STD OUT exporter, set the following environment variable:

  • STDOUT_ENABLED: Set to false to disable the STD OUT exporter.
SYSLOG

The SYSLOG exporter is used to send the alerts to a syslog server. This exporter is disabled by default. NOTE: The SYSLOG messages format is RFC 5424. To enable the SYSLOG exporter, set the following environment variables:

  • SYSLOG_HOST: The host of the syslog server. Example: localhost:514
  • SYSLOG_PROTOCOL: The protocol of the syslog server. Example: tcp or udp

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitExporters

func InitExporters(exportersConfig ExportersConfig)

InitExporters initializes all exporters

func PriorityToStatus

func PriorityToStatus(priority int) string

func SendAlert

func SendAlert(failedRule rule.RuleFailure)

Types

type AlertManagerExporter

type AlertManagerExporter struct {
	Host     string
	NodeName string
	// contains filtered or unexported fields
}

func InitAlertManagerExporter

func InitAlertManagerExporter(alertmanagerURL string) *AlertManagerExporter

func (*AlertManagerExporter) SendAlert

func (ame *AlertManagerExporter) SendAlert(failedRule rule.RuleFailure)

type Exporter

type Exporter interface {
	// SendAlert sends an alert to the exporter
	SendAlert(failedRule rule.RuleFailure)
}

generic exporter interface

type ExportersConfig

type ExportersConfig struct {
	StdoutExporter          *bool  `yaml:"stdoutExporter"`
	AlertManagerExporterURL string `yaml:"alertManagerExporterURL"`
	SyslogExporter          string `yaml:"syslogExporterURL"`
}

type StdoutExporter

type StdoutExporter struct {
	// contains filtered or unexported fields
}

func InitStdoutExporter

func InitStdoutExporter(useStdout *bool) *StdoutExporter

func (*StdoutExporter) SendAlert

func (exporter *StdoutExporter) SendAlert(failedRule rule.RuleFailure)

type SyslogExporter added in v0.0.14

type SyslogExporter struct {
	// contains filtered or unexported fields
}

SyslogExporter is an exporter that sends alerts to syslog

func InitSyslogExporter added in v0.0.14

func InitSyslogExporter(syslogHost string) *SyslogExporter

InitSyslogExporter initializes a new SyslogExporter

func (*SyslogExporter) SendAlert added in v0.0.14

func (se *SyslogExporter) SendAlert(failedRule rule.RuleFailure)

SendAlert sends an alert to syslog (RFC 5424) - https://tools.ietf.org/html/rfc5424

Jump to

Keyboard shortcuts

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