https://github.com/crdsonnet/alertmanager-libsonnet
Jsonnet library for configuring alertmanager and installing it on Kubernetes.
https://github.com/crdsonnet/alertmanager-libsonnet
alertmanager jsonnet jsonnet-lib
Last synced: 7 months ago
JSON representation
Jsonnet library for configuring alertmanager and installing it on Kubernetes.
- Host: GitHub
- URL: https://github.com/crdsonnet/alertmanager-libsonnet
- Owner: crdsonnet
- License: apache-2.0
- Created: 2023-03-24T18:47:02.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-01-24T13:18:37.000Z (8 months ago)
- Last Synced: 2025-01-24T14:22:01.477Z (8 months ago)
- Topics: alertmanager, jsonnet, jsonnet-lib
- Language: Jsonnet
- Homepage:
- Size: 196 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# alertmanager-libsonnet
This project provides a jsonnet library for configuring
[alertmanager](https://github.com/prometheus/alertmanager) and installing it on Kubernetes.The alertmanagerConfig library is generated from a JSON schema derived from the
Go structs in Alertmanager. The alertmanagerKube library is manually curated.## Example
```jsonnet
local alertmanagerConfig = import 'github.com/crdsonnet/alertmanager-libsonnet/alertmanagerConfig/main.libsonnet';
local alertmanagerKube = import 'github.com/crdsonnet/alertmanager-libsonnet/alertmanagerKube/main.libsonnet';local testReceiver =
alertmanagerConfig.receivers.new('test')
+ alertmanagerConfig.receivers.withSlackConfigs([
alertmanagerConfig.receivers.slack_configs.new('#general'),
])
+ alertmanagerConfig.receivers.withWebhookConfigs([
alertmanagerConfig.receivers.webhook_configs.new('http://localhost/hot/new/webhook'),
]);local config =
alertmanagerConfig.withRoute([
alertmanagerConfig.route.withReceiver(testReceiver.name),
])
+ alertmanagerConfig.withReceivers([
testReceiver,
]);alertmanagerKube.new()
+ alertmanagerKube.withConfig(config)
```## Docs
See docs to [configure](./alertmanagerConfig/docs/README.md) and [install](./alertmanagerKube/docs/README.md).