alertmanagerexporter

package module
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

README

Alertmanager Exporter

Status
Stability development: traces
Distributions []
Issues Open issues Closed issues
Code Owners @jpkrohling, @sokoide, @mcube8

Exports OTEL Events (SpanEvent in Tracing added by AddEvent API) as Alerts to Alertmanager back-end to notify Errors or Change events.

Supported pipeline types: traces

Getting Started

The following settings are required:

  • endpoint: Alertmanager endpoint to send events
  • severity: Default severity for Alerts

The following settings are optional:

  • timeout sending_queue and retry_on_failure settings as provided by Exporter Helper
  • HTTP settings
  • TLS and mTLS settings
  • generator_url is the source of the alerts to be used in Alertmanager's payload. The default value is "opentelemetry-collector", and can be set to the URL of the opentelemetry collector.
  • severity_attribute is the SpanEvent Attribute name which can be used instead of default severity string in Alert payload e.g.: If severity_attribute is set to "foo" and the SpanEvent has an attribute called foo, foo's attribute value will be used as the severity value for that particular Alert generated from the SpanEvent.

Example config:

exporters:
  alertmanager:
  alertmanager/2:
    endpoint: "https://a.new.alertmanager.target:9093"
    severity: "debug"
    severity_attribute: "foo"
    tls:
      cert_file: /var/lib/mycert.pem
      key_file: /var/lib/key.pem
    timeout: 10s
    sending_queue:
      enabled: true
      num_consumers: 2
      queue_size: 10
    retry_on_failure:
      enabled: true
      initial_interval: 10s
      max_interval: 60s
      max_elapsed_time: 10m
    generator_url: "opentelemetry-collector"

Documentation

Overview

Package alertmanagerexporter exports spanevents as alerts to Prometheus Alertmanager

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() exporter.Factory

NewFactory creates a factory for Alertmanager exporter

Types

type Config

type Config struct {
	exporterhelper.TimeoutSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
	exporterhelper.QueueSettings   `mapstructure:"sending_queue"`
	BackoffConfig                  configretry.BackOffConfig `mapstructure:"retry_on_failure"`

	confighttp.ClientConfig `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct.
	GeneratorURL            string                   `mapstructure:"generator_url"`
	DefaultSeverity         string                   `mapstructure:"severity"`
	SeverityAttribute       string                   `mapstructure:"severity_attribute"`
}

Config defines configuration for alertmanager exporter.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate checks if the exporter configuration is valid

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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