alertmanagerConfig can generate config for alertmanager.
Additional information about the configuration options can be found in the official docs.
jb install github.com/crdsonnet/alertmanager-libsonnet/alertmanagerConfig@master
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,
])
fn withGlobal(value)fn withGlobalMixin(value)fn withInhibitRules(value)fn withInhibitRulesMixin(value)fn withMuteTimeIntervals(value)fn withMuteTimeIntervalsMixin(value)fn withReceivers(value)fn withReceiversMixin(value)fn withRoute(value)fn withRouteMixin(value)fn withTemplates(value)fn withTemplatesMixin(value)fn withTimeIntervals(value)fn withTimeIntervalsMixin(value)obj util
withGlobal(value)PARAMETERS:
- value (
object)
withGlobalMixin(value)PARAMETERS:
- value (
object)
withInhibitRules(value)PARAMETERS:
- value (
array)
withInhibitRulesMixin(value)PARAMETERS:
- value (
array)
withMuteTimeIntervals(value)PARAMETERS:
- value (
array)
withMuteTimeIntervalsMixin(value)PARAMETERS:
- value (
array)
withReceivers(value)PARAMETERS:
- value (
array)
withReceiversMixin(value)PARAMETERS:
- value (
array)
withRoute(value)PARAMETERS:
- value (
object)
withRouteMixin(value)PARAMETERS:
- value (
object)
withTemplates(value)PARAMETERS:
- value (
array)
withTemplatesMixin(value)PARAMETERS:
- value (
array)
withTimeIntervals(value)PARAMETERS:
- value (
array)
withTimeIntervalsMixin(value)PARAMETERS:
- value (
array)
util.getCommonTemplates()getCommonTemplates provides a set of common templates to use with Alertmanager.
util.getReceiverNamesFromRoute(route)PARAMETERS:
- route (
object)
getReceiverNamesFromRoute returns a set of receivers from a route.
util.getReceiversForRoute(receivers, route)PARAMETERS:
- receivers (
array) - route (
object)
getReceiversForRoute returns the subset of receivers actually used in given route.
util.getUndefinedReceiversFromRoute(receivers, route)PARAMETERS:
- receivers (
array) - route (
object)
getUndefinedReceiversFromRoute returns which receivers are undefined but used in a route.
util.matchArrayOrString(key, arr)PARAMETERS:
- key (
string) - arr (
array)
matchArrayOrString creates a matcher string.