Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow configuration of ring members in gossip alerts #301

Merged
merged 6 commits into from
Aug 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions cortex-mixin/alerts/alerts.libsonnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{
// simpleRegexpOpt produces a simple regexp that matches all strings in the input array.
local simpleRegexpOpt(strings) =
assert std.isArray(strings) : 'simpleRegexpOpt requires that `strings` is an array of strings`';
'(' + std.join('|', strings) + ')',

groups+: [
{
name: 'cortex_alerts',
Expand Down Expand Up @@ -590,11 +595,12 @@
rules: [
{
alert: 'CortexGossipMembersMismatch',
expr: |||
memberlist_client_cluster_members_count
!= on (%s) group_left
sum by (%s) (up{job=~".+/(admin-api|compactor|store-gateway|distributor|ingester.*|querier.*|cortex|ruler)"})
||| % [$._config.alert_aggregation_labels, $._config.alert_aggregation_labels],
expr:
|||
memberlist_client_cluster_members_count
!= on (%s) group_left
sum by (%s) (up{job=~".+/%s"})
||| % [$._config.alert_aggregation_labels, $._config.alert_aggregation_labels, simpleRegexpOpt($._config.job_names.ring_members)],
'for': '5m',
labels: {
severity: 'warning',
Expand Down
1 change: 1 addition & 0 deletions cortex-mixin/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
query_frontend: '(query-frontend.*|cortex$)', // Match also custom query-frontend deployments.
query_scheduler: 'query-scheduler.*', // Not part of single-binary. Match also custom query-scheduler deployments.
table_manager: '(table-manager|cortex$)',
ring_members: ['compactor', 'distributor', 'ingester.*', 'querier.*', 'ruler', 'store-gateway', 'cortex'],
store_gateway: '(store-gateway|cortex$)',
gateway: '(gateway|cortex-gw|cortex-gw-internal)',
compactor: 'compactor.*', // Match also custom compactor deployments.
Expand Down