Skip to content

Commit

Permalink
Changed alertmanager config to use the new storage config
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Pracucci <[email protected]>
  • Loading branch information
pracucci committed May 17, 2021
1 parent e5cba39 commit 594070b
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions operations/mimir/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -253,19 +253,15 @@
},

ruler_enabled: false,
ruler_client_type: error 'you must specify a storage backend type for the ruler (azure, configdb, gcs, s3, local)',
// TODO: Generic client generating functions would be nice.
ruler_s3_bucket_name: $._config.s3_bucket_name,
ruler_client_type: error 'you must specify a storage backend type for the ruler (azure, gcs, s3, local)',
ruler_s3_bucket_name: error 'you must specify the ruler S3 bucket name',
ruler_gcs_bucket_name: error 'must specify a GCS bucket name',

rulerClientConfig:
{
'ruler-storage.backend': $._config.ruler_client_type,
} +
{
configdb: {
configs_api_url: 'config.%s.svc.cluster.local' % $._config.namespace,
},
gcs: {
'ruler-storage.gcs.bucket-name': $._config.ruler_gcs_bucket_name,
},
Expand All @@ -284,26 +280,24 @@
fallback_config: {},
},

alertmanager_client_type: error 'you must specify a storage backend type for the alertmanager (azure, configdb, gcs, s3, local)',
alertmanager_s3_bucket_name: $._config.s3_bucket_name,
alertmanager_client_type: error 'you must specify a storage backend type for the alertmanager (azure, gcs, s3, local)',
alertmanager_s3_bucket_name: error 'you must specify the alertmanager S3 bucket name',
alertmanager_gcs_bucket_name: error 'must specify a GCS bucket name',

alertmanagerStorageClientConfig:
{
'alertmanager.storage.type': $._config.alertmanager_client_type,
'alertmanager-storage.backend': $._config.alertmanager_client_type,
} +
{
configdb: {
configs_api_url: 'config.%s.svc.cluster.local' % $._config.namespace,
},
gcs: {
'alertmanager.storage.gcs.bucketname': $._config.alertmanager_gcs_bucket_name,
'alertmanager-storage.gcs.bucket-name': $._config.alertmanager_gcs_bucket_name,
},
s3: {
'alertmanager.storage.s3.url': 'https://%s/%s' % [$._config.aws_region, $._config.alertmanager_s3_bucket_name],
'alertmanager-storage.s3.region': $._config.aws_region,
'alertmanager-storage.s3.bucket-name': $._config.alertmanager_s3_bucket_name,
},
'local': {
'alertmanager.storage.local.directory': $._config.alertmanager_local_directory,
'alertmanager-storage.local.path': $._config.alertmanager_local_directory,
},
}[$._config.alertmanager_client_type],

Expand Down

0 comments on commit 594070b

Please sign in to comment.