-
Notifications
You must be signed in to change notification settings - Fork 557
/
Copy pathscaling.libsonnet
59 lines (57 loc) · 2.45 KB
/
scaling.libsonnet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
local utils = import 'mixin-utils/utils.libsonnet';
(import 'dashboard-utils.libsonnet') {
'mimir-scaling.json':
($.dashboard('Scaling') + { uid: '88c041017b96856c9176e07cf557bdcf' })
.addClusterSelectorTemplates()
.addRow(
($.row('Service scaling') + { height: '200px' })
.addPanel({
type: 'text',
title: '',
options: {
content: |||
This dashboards shows any services which are not scaled correctly.
The table below gives the required number of replicas and the reason why.
We only show services without enough replicas.
Reasons:
- **sample_rate**: There are not enough replicas to handle the
sample rate. Applies to distributor and ingesters.
- **active_series**: There are not enough replicas
to handle the number of active series. Applies to ingesters.
- **cpu_usage**: There are not enough replicas
based on the CPU usage of the jobs vs the resource requests.
Applies to all jobs.
- **memory_usage**: There are not enough replicas based on the memory
usage vs the resource requests. Applies to all jobs.
- **active_series_limits**: There are not enough replicas to hold 60% of the
sum of all the per tenant series limits.
- **sample_rate_limits**: There are not enough replicas to handle 60% of the
sum of all the per tenant rate limits.
|||,
mode: 'markdown',
},
})
)
.addRow(
($.row('Scaling') + { height: '400px' })
.addPanel(
$.panel('Workload-based scaling') + { sort: { col: 0, desc: false } } +
$.tablePanel([
|||
sort_desc(
%(alert_aggregation_rule_prefix)s_deployment_reason:required_replicas:count{%(clusterLabel)s=~"$cluster", namespace=~"$namespace"}
> ignoring(reason) group_left
%(alert_aggregation_rule_prefix)s_deployment:actual_replicas:count{%(clusterLabel)s=~"$cluster", namespace=~"$namespace"}
)
||| % $._config,
], {
__name__: { alias: 'Cluster', type: 'hidden' },
cluster: { alias: 'Cluster' },
namespace: { alias: 'Namespace' },
deployment: { alias: 'Service' },
reason: { alias: 'Reason' },
Value: { alias: 'Required Replicas', decimals: 0 },
})
)
),
}