Skip to content

Commit

Permalink
mixin: Remove support for removed cache metrics (#9674)
Browse files Browse the repository at this point in the history
Remove backwards compatibility support for `thanos_memcached_` prefixed
metrics that were removed over a year ago in favor of `thanos_cache_`
metrics.

Signed-off-by: Nick Pillitteri <[email protected]>
  • Loading branch information
56quarters authored Oct 18, 2024
1 parent d534195 commit 7a69789
Show file tree
Hide file tree
Showing 10 changed files with 374 additions and 272 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@

### Mixin

* [CHANGE] Remove backwards compatibility for `thanos_memcached_` prefixed metrics in dashboards and alerts removed in 2.12. #9674
* [ENHANCEMENT] Unify ingester autoscaling panels on 'Mimir / Writes' dashboard to work for both ingest-storage and non-ingest-storage autoscaling. #9617
* [BUGFIX] Dashboards: Fix autoscaling metrics joins when series churn. #9412 #9450 #9432
* [BUGFIX] Alerts: Fix autoscaling metrics joins in `MimirAutoscalerNotActive` when series churn. #9412
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,10 @@ spec:
expr: |
(
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operation_failures_total{operation!="add"}[1m])
or
rate(thanos_cache_operation_failures_total{operation!="add"}[1m])
)
/
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operations_total{operation!="add"}[1m])
or
rate(thanos_cache_operations_total{operation!="add"}[1m])
)
) * 100 > 5
Expand Down
4 changes: 0 additions & 4 deletions operations/mimir-mixin-compiled-baremetal/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,10 @@ groups:
expr: |
(
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operation_failures_total{operation!="add"}[1m])
or
rate(thanos_cache_operation_failures_total{operation!="add"}[1m])
)
/
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operations_total{operation!="add"}[1m])
or
rate(thanos_cache_operations_total{operation!="add"}[1m])
)
) * 100 > 5
Expand Down
171 changes: 123 additions & 48 deletions operations/mimir-mixin-compiled-baremetal/dashboards/mimir-reads.json

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions operations/mimir-mixin-compiled/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,10 @@ groups:
expr: |
(
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operation_failures_total{operation!="add"}[1m])
or
rate(thanos_cache_operation_failures_total{operation!="add"}[1m])
)
/
sum by(cluster, namespace, name, operation) (
rate(thanos_memcached_operations_total{operation!="add"}[1m])
or
rate(thanos_cache_operations_total{operation!="add"}[1m])
)
) * 100 > 5
Expand Down
171 changes: 123 additions & 48 deletions operations/mimir-mixin-compiled/dashboards/mimir-reads.json

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions operations/mimir-mixin/alerts/alerts.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,10 @@ local utils = import 'mixin-utils/utils.libsonnet';
expr: |||
(
sum by(%(group_by)s, name, operation) (
rate(thanos_memcached_operation_failures_total{operation!="add"}[%(range_interval)s])
or
rate(thanos_cache_operation_failures_total{operation!="add"}[%(range_interval)s])
)
/
sum by(%(group_by)s, name, operation) (
rate(thanos_memcached_operations_total{operation!="add"}[%(range_interval)s])
or
rate(thanos_cache_operations_total{operation!="add"}[%(range_interval)s])
)
) * 100 > 5
Expand Down
99 changes: 2 additions & 97 deletions operations/mimir-mixin/dashboards/dashboard-utils.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -1198,13 +1198,6 @@ local utils = import 'mixin-utils/utils.libsonnet';
$.queryPanel(
|||
sum by(operation) (
# Backwards compatibility
rate(thanos_memcached_operations_total{
%(jobMatcher)s,
component="%(component)s",
name="%(cacheName)s"
}[$__rate_interval])
or ignoring(backend)
rate(thanos_cache_operations_total{
%(jobMatcher)s,
component="%(component)s",
Expand All @@ -1219,8 +1212,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
)
.addPanel(
$.timeseriesPanel('Latency (getmulti)') +
$.backwardsCompatibleLatencyPanel(
'thanos_memcached_operation_duration_seconds',
$.latencyPanel(
'thanos_cache_operation_duration_seconds',
|||
{
Expand All @@ -1237,13 +1229,6 @@ local utils = import 'mixin-utils/utils.libsonnet';
$.queryPanel(
|||
sum(
# Backwards compatibility
rate(thanos_cache_memcached_hits_total{
%(jobMatcher)s,
component="%(component)s",
name="%(cacheName)s"
}[$__rate_interval])
or
rate(thanos_cache_hits_total{
%(jobMatcher)s,
component="%(component)s",
Expand All @@ -1252,13 +1237,6 @@ local utils = import 'mixin-utils/utils.libsonnet';
)
/
sum(
# Backwards compatibility
rate(thanos_cache_memcached_requests_total{
%(jobMatcher)s,
component="%(component)s",
name="%(cacheName)s"
}[$__rate_interval])
or
rate(thanos_cache_requests_total{
%(jobMatcher)s,
component="%(component)s",
Expand Down Expand Up @@ -1318,76 +1296,6 @@ local utils = import 'mixin-utils/utils.libsonnet';
},
},

// Copy/paste of latencyPanel from grafana-builder so that we can migrate between two different
// names for the same metric. When enough time has passed and we no longer care about the old
// metric name, this method can be removed and replaced with $.latencyPanel
backwardsCompatibleLatencyPanel(oldMetricName, newMetricName, selector, multiplier='1e3'):: {
targets: [
{
expr: |||
histogram_quantile(0.99, sum(
# Backwards compatibility
rate(%s_bucket%s[$__rate_interval])
or
rate(%s_bucket%s[$__rate_interval])
) by (le)) * %s
||| % [oldMetricName, selector, newMetricName, selector, multiplier],
format: 'time_series',
intervalFactor: 2,
legendFormat: '99th Percentile',
refId: 'A',
},
{
expr: |||
histogram_quantile(0.50, sum(
# Backwards compatibility
rate(%s_bucket%s[$__rate_interval])
or
rate(%s_bucket%s[$__rate_interval])
) by (le)) * %s
||| % [oldMetricName, selector, newMetricName, selector, multiplier],
format: 'time_series',
intervalFactor: 2,
legendFormat: '50th Percentile',
refId: 'B',
},
{
expr: |||
sum(
# Backwards compatibility
rate(%s_sum%s[$__rate_interval])
or
rate(%s_sum%s[$__rate_interval])
) * %s
/
sum(
# Backwards compatibility
rate(%s_count%s[$__rate_interval])
or
rate(%s_count%s[$__rate_interval])
)
||| % [
oldMetricName,
selector,
newMetricName,
selector,
multiplier,
oldMetricName,
selector,
newMetricName,
selector,
],
format: 'time_series',
intervalFactor: 2,
legendFormat: 'Average',
refId: 'C',
},
],
fieldConfig+: {
defaults+: { unit: 'ms', noValue: 0 },
},
},

latencyRecordingRulePanel(metric, selectors, extra_selectors=[], multiplier='1e3', sum_by=[])::
utils.latencyRecordingRulePanel(metric, selectors, extra_selectors, multiplier, sum_by) + {
// Hide yaxes from JSON Model; it's not supported by timeseriesPanel.
Expand Down Expand Up @@ -1735,8 +1643,6 @@ local utils = import 'mixin-utils/utils.libsonnet';
$.queryPanel(
|||
sum (
rate(thanos_memcached_operations_total{name="frontend-cache", %(frontend)s}[$__rate_interval])
or ignoring(backend)
rate(thanos_cache_operations_total{name="frontend-cache", %(frontend)s}[$__rate_interval])
)
||| % {
Expand All @@ -1748,8 +1654,7 @@ local utils = import 'mixin-utils/utils.libsonnet';
)
.addPanel(
$.timeseriesPanel('Latency') +
$.backwardsCompatibleLatencyPanel(
'thanos_memcached_operation_duration_seconds',
$.latencyPanel(
'thanos_cache_operation_duration_seconds',
'{%s, name="frontend-cache"}' % $.jobMatcher(queryFrontendJobName)
)
Expand Down
17 changes: 2 additions & 15 deletions operations/mimir-mixin/dashboards/reads.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -345,15 +345,6 @@ local filename = 'mimir-reads.json';
$.queryPanel(
|||
sum by(operation) (
# Backwards compatibility
rate(
thanos_memcached_operations_total{
component="store-gateway",
name="index-cache",
%s
}[$__rate_interval]
)
or ignoring(backend)
rate(
thanos_cache_operations_total{
component="store-gateway",
Expand All @@ -362,19 +353,15 @@ local filename = 'mimir-reads.json';
}[$__rate_interval]
)
)
||| % [
$.jobMatcher($._config.job_names.store_gateway),
$.jobMatcher($._config.job_names.store_gateway),
],
||| % $.jobMatcher($._config.job_names.store_gateway),
'{{operation}}'
) +
$.stack +
{ fieldConfig+: { defaults+: { unit: 'ops' } } }
)
.addPanel(
$.timeseriesPanel('Latency (getmulti)') +
$.backwardsCompatibleLatencyPanel(
'thanos_memcached_operation_duration_seconds',
$.latencyPanel(
'thanos_cache_operation_duration_seconds',
|||
{
Expand Down

0 comments on commit 7a69789

Please sign in to comment.