Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Commit 551eb33

Browse files
authored
Merge pull request #258 from grafana/20210208_configurable_alertmanager_storage
feat: allow for Alertmanager to configure multiple storage backends
2 parents ea33cb1 + 65a6bc6 commit 551eb33

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22

33
## master / unreleased
44

5+
* [CHANGE] Alertmanager storage backend no longer defaults to `gcs` with bucket name `'%(cluster)s-cortex-%(namespace)s' % $._config`. #258
56
* [CHANGE] Only single cluster and namespace can now be selected in "resources" dashboards. #251
67
* [CHANGE] Increased `CortexAllocatingTooMuchMemory` warning alert threshold from 50% to 65%. #256
78
* [CHANGE] Cleaned up blocks storage config. Moved CLI flags used only be the read path from `genericBlocksStorageConfig` to `queryBlocksStorageConfig`, and flags used only by the ingester from `genericBlocksStorageConfig` to `ingester_args`. #257
9+
* [ENHANCEMENT] Add dedicated parameters to `_config` to configure Alertmanager backend storage. #258
10+
* `alertmanager_client_type`
11+
* `alertmanager_s3_bucket_name`
12+
* `alertmanager_gcs_bucket_name`
813
* [ENHANCEMENT] Added `unregister_ingesters_on_shutdown` config option to disable unregistering ingesters on shutdown (default is enabled). #213
914
* [ENHANCEMENT] Improved blocks storage observability: #237
1015
- Cortex / Queries: added bucket index load operations and latency (available only when bucket index is enabled)

cortex/alertmanager.libsonnet

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,12 @@
1818

1919
alertmanager_args::
2020
$._config.grpcConfig +
21+
$._config. alertmanagerStorageClientConfig +
2122
{
2223
target: 'alertmanager',
2324
'log.level': 'debug',
24-
2525
'experimental.alertmanager.enable-api': 'true',
26-
'alertmanager.storage.type': 'gcs',
2726
'alertmanager.storage.path': '/data',
28-
'alertmanager.storage.gcs.bucketname': '%(cluster)s-cortex-%(namespace)s' % $._config,
2927
'alertmanager.web.external-url': '%s/alertmanager' % $._config.external_url,
3028
} + if hasFallbackConfig then {
3129
'alertmanager.configs.fallback': '/configs/alertmanager_fallback_config.yaml',

cortex/config.libsonnet

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,29 @@
283283
fallback_config: {},
284284
},
285285

286+
alertmanager_client_type: error 'you must specify a storage backend type for the ruler (azure, configdb, gcs, s3, local)',
287+
alertmanager_s3_bucket_name: $._config.s3_bucket_name,
288+
alertmanager_gcs_bucket_name: error 'must specify a GCS bucket name',
289+
290+
alertmanagerStorageClientConfig:
291+
{
292+
'alertmanager.storage.type': $._config.alertmanager_client_type,
293+
} +
294+
{
295+
configdb: {
296+
configs_api_url: 'config.%s.svc.cluster.local' % $._config.namespace,
297+
},
298+
gcs: {
299+
'alertmanager.storage.gcs.bucketname': $._config.alertmanager_gcs_bucket_name,
300+
},
301+
s3: {
302+
'alertmanager.storage.s3.url': 'https://%s/%s' % [$._config.aws_region, $._config.alertmanager_s3_bucket_name],
303+
},
304+
'local': {
305+
'alertmanager.storage.local.directory': $._config.alertmanager_local_directory,
306+
},
307+
}[$._config.alertmanager_client_type],
308+
286309
// === Per-tenant usage limits. ===
287310
//
288311
// These are the defaults.

0 commit comments

Comments
 (0)