Skip to content

Latest commit

 

History

History
283 lines (176 loc) · 4.85 KB

File metadata and controls

283 lines (176 loc) · 4.85 KB

alertmanagerConfig

alertmanagerConfig can generate config for alertmanager.

Additional information about the configuration options can be found in the official docs.

Install

jb install github.com/crdsonnet/alertmanager-libsonnet/alertmanagerConfig@master

Usage

local alertmanagerConfig = import "github.com/crdsonnet/alertmanager-libsonnet/alertmanagerConfig/main.libsonnet";

local testReceiver =
  alertmanagerConfig.receiver.new('test')
  + alertmanagerConfig.receiver.withSlackConfigs([
    alertmanagerConfig.receiver.slack.new('#general'),
  ])
  + alertmanagerConfig.receiver.withWebhookConfigs([
    alertmanagerConfig.receiver.webhook.new('http://localhost/hot/new/webhook'),
  ]);

alertmanagerConfig.withRoute([
  alertmanagerConfig.route.withReceiver(testReceiver.name),
])
+ alertmanagerConfig.withReceivers([
  testReceiver,
])

Subpackages

Index

Fields

fn withGlobal

withGlobal(value)

PARAMETERS:

  • value (object)

fn withGlobalMixin

withGlobalMixin(value)

PARAMETERS:

  • value (object)

fn withInhibitRules

withInhibitRules(value)

PARAMETERS:

  • value (array)

fn withInhibitRulesMixin

withInhibitRulesMixin(value)

PARAMETERS:

  • value (array)

fn withMuteTimeIntervals

withMuteTimeIntervals(value)

PARAMETERS:

  • value (array)

fn withMuteTimeIntervalsMixin

withMuteTimeIntervalsMixin(value)

PARAMETERS:

  • value (array)

fn withReceivers

withReceivers(value)

PARAMETERS:

  • value (array)

fn withReceiversMixin

withReceiversMixin(value)

PARAMETERS:

  • value (array)

fn withRoute

withRoute(value)

PARAMETERS:

  • value (object)

fn withRouteMixin

withRouteMixin(value)

PARAMETERS:

  • value (object)

fn withTemplates

withTemplates(value)

PARAMETERS:

  • value (array)

fn withTemplatesMixin

withTemplatesMixin(value)

PARAMETERS:

  • value (array)

fn withTimeIntervals

withTimeIntervals(value)

PARAMETERS:

  • value (array)

fn withTimeIntervalsMixin

withTimeIntervalsMixin(value)

PARAMETERS:

  • value (array)

obj util

fn util.getCommonTemplates

util.getCommonTemplates()

getCommonTemplates provides a set of common templates to use with Alertmanager.

fn util.getReceiverNamesFromRoute

util.getReceiverNamesFromRoute(route)

PARAMETERS:

  • route (object)

getReceiverNamesFromRoute returns a set of receivers from a route.

fn util.getReceiversForRoute

util.getReceiversForRoute(receivers, route)

PARAMETERS:

  • receivers (array)
  • route (object)

getReceiversForRoute returns the subset of receivers actually used in given route.

fn util.getUndefinedReceiversFromRoute

util.getUndefinedReceiversFromRoute(receivers, route)

PARAMETERS:

  • receivers (array)
  • route (object)

getUndefinedReceiversFromRoute returns which receivers are undefined but used in a route.

fn util.matchArrayOrString

util.matchArrayOrString(key, arr)

PARAMETERS:

  • key (string)
  • arr (array)

matchArrayOrString creates a matcher string.