diff --git a/CHANGELOG.md b/CHANGELOG.md index 40a38ba1e7f..e3663759b59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## main / unreleased * [ENHANCEMENT] Expose `upto` parameter on hedged requests for each backend with `hedge_requests_up_to`. [#1085](https://github.com/grafana/tempo/pull/1085) (@joe-elliott) +* [ENHANCEMENT] Jsonnet: add `$._config.namespace` to filter by namespace in cortex metrics [#1098](https://github.com/grafana/tempo/pull/1098) (@mapno) ## v1.2.0 / 2021-11-05 * [CHANGE] **BREAKING CHANGE** Drop support for v0 and v1 blocks. See [1.1 changelog](https://github.com/grafana/tempo/releases/tag/v1.1.0) for details [#919](https://github.com/grafana/tempo/pull/919) (@joe-elliott) diff --git a/operations/tempo-mixin/alerts.libsonnet b/operations/tempo-mixin/alerts.libsonnet index 7b5fc4e4a90..bf149d6611b 100644 --- a/operations/tempo-mixin/alerts.libsonnet +++ b/operations/tempo-mixin/alerts.libsonnet @@ -42,8 +42,8 @@ { alert: 'TempoCompactorUnhealthy', expr: ||| - max by (%s) (cortex_ring_members{state="Unhealthy", name="%s"}) > 0 - ||| % [$._config.group_by_cluster, $._config.jobs.compactor], + max by (%s) (cortex_ring_members{state="Unhealthy", name="%s", namespace=~"%s"}) > 0 + ||| % [$._config.group_by_cluster, $._config.jobs.compactor, $._config.namespace], 'for': '15m', labels: { severity: 'critical', @@ -57,8 +57,8 @@ alert: 'TempoDistributorUnhealthy', 'for': '15m', expr: ||| - max by (%s) (cortex_ring_members{state="Unhealthy", name="%s"}) > 0 - ||| % [$._config.group_by_cluster, $._config.jobs.distributor], + max by (%s) (cortex_ring_members{state="Unhealthy", name="%s", namespace=~"%s"}) > 0 + ||| % [$._config.group_by_cluster, $._config.jobs.distributor, $._config.namespace], labels: { severity: 'warning', }, diff --git a/operations/tempo-mixin/config.libsonnet b/operations/tempo-mixin/config.libsonnet index 37c006e5caa..f7f11084006 100644 --- a/operations/tempo-mixin/config.libsonnet +++ b/operations/tempo-mixin/config.libsonnet @@ -4,6 +4,7 @@ _config+:: { http_api_prefix: '', + namespace: '.*', jobs: { gateway: 'cortex-gw', query_frontend: 'query-frontend', diff --git a/operations/tempo-mixin/yamls/alerts.yaml b/operations/tempo-mixin/yamls/alerts.yaml index 2bf5bce130b..f21d525932e 100644 --- a/operations/tempo-mixin/yamls/alerts.yaml +++ b/operations/tempo-mixin/yamls/alerts.yaml @@ -29,7 +29,7 @@ "message": "There are {{ printf \"%f\" $value }} unhealthy compactor(s)." "runbook_url": "https://github.com/grafana/tempo/tree/main/operations/tempo-mixin/runbook.md#TempoCompactorUnhealthy" "expr": | - max by (cluster, namespace) (cortex_ring_members{state="Unhealthy", name="compactor"}) > 0 + max by (cluster, namespace) (cortex_ring_members{state="Unhealthy", name="compactor", namespace=~".*"}) > 0 "for": "15m" "labels": "severity": "critical" @@ -38,7 +38,7 @@ "message": "There are {{ printf \"%f\" $value }} unhealthy distributor(s)." "runbook_url": "https://github.com/grafana/tempo/tree/main/operations/tempo-mixin/runbook.md#TempoDistributorUnhealthy" "expr": | - max by (cluster, namespace) (cortex_ring_members{state="Unhealthy", name="distributor"}) > 0 + max by (cluster, namespace) (cortex_ring_members{state="Unhealthy", name="distributor", namespace=~".*"}) > 0 "for": "15m" "labels": "severity": "warning"