Skip to content

Commit 28ada05

Browse files
committed
Tweaked timeseries panels to match best practices
1 parent 91ca428 commit 28ada05

File tree

3 files changed

+131
-5
lines changed

3 files changed

+131
-5
lines changed

squid-mixin/dashboards_out/squid-overview.json

Lines changed: 70 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

squid-mixin/mixin.libsonnet

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ local mixin = mixinlib.new()
1212
}
1313
);
1414

15+
local label_patch = {
16+
cluster+: {
17+
allValue: '.*',
18+
},
19+
};
20+
1521
{
1622
grafanaDashboards+:: {
1723
[fname]:
1824
local dashboard = util.decorate_dashboard(mixin.grafana.dashboards[fname], tags=config.dashboardTags);
19-
dashboard
25+
dashboard + util.patch_variables(dashboard, label_patch)
2026

2127
for fname in std.objectFields(mixin.grafana.dashboards)
2228
},

squid-mixin/panels.libsonnet

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
1515
+ g.query.prometheus.withInterval('2m')
1616
+ g.query.prometheus.withIntervalFactor(2),
1717
])
18+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
19+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
20+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
1821
+ g.panel.timeSeries.standardOptions.withUnit('reqps'),
1922

2023
clientRequestErrors:
@@ -25,6 +28,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
2528
+ g.query.prometheus.withInterval('2m')
2629
+ g.query.prometheus.withIntervalFactor(2),
2730
])
31+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
32+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
33+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
2834
+ g.panel.timeSeries.standardOptions.withUnit('errors/s'),
2935

3036
clientCacheHitRatio:
@@ -35,6 +41,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
3541
+ g.query.prometheus.withInterval('2m')
3642
+ g.query.prometheus.withIntervalFactor(2),
3743
])
44+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
45+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
46+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
3847
+ g.panel.timeSeries.standardOptions.withUnit('percent'),
3948

4049
clientRequestSentThroughput:
@@ -45,6 +54,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
4554
+ g.query.prometheus.withInterval('2m')
4655
+ g.query.prometheus.withIntervalFactor(2),
4756
])
57+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
58+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
59+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
4860
+ g.panel.timeSeries.standardOptions.withUnit('KBs'),
4961

5062
clientHTTPReceivedThroughput:
@@ -55,6 +67,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
5567
+ g.query.prometheus.withInterval('2m')
5668
+ g.query.prometheus.withIntervalFactor(2),
5769
])
70+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
71+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
72+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
5873
+ g.panel.timeSeries.standardOptions.withUnit('KBs'),
5974

6075
clientCacheHitThroughput:
@@ -65,6 +80,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
6580
+ g.query.prometheus.withInterval('2m')
6681
+ g.query.prometheus.withIntervalFactor(2),
6782
])
83+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
84+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
85+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
6886
+ g.panel.timeSeries.standardOptions.withUnit('KBs'),
6987

7088
httpRequestServiceTime:
@@ -75,6 +93,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
7593
signals.overview.httpRequestsAll75.asTarget(),
7694
signals.overview.httpRequestsAll95.asTarget(),
7795
])
96+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
97+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
98+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
7899
+ g.panel.timeSeries.standardOptions.withUnit('s'),
79100

80101
cacheHitServiceTime:
@@ -88,6 +109,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
88109
signals.overview.cacheHits95.asTarget()
89110
+ g.query.prometheus.withIntervalFactor(2),
90111
])
112+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
113+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
114+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
91115
+ g.panel.timeSeries.standardOptions.withUnit('s'),
92116

93117
cacheMissesServiceTime:
@@ -101,6 +125,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
101125
signals.overview.cacheMisses95.asTarget()
102126
+ g.query.prometheus.withIntervalFactor(2),
103127
])
128+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
129+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
130+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
104131
+ g.panel.timeSeries.standardOptions.withUnit('s'),
105132

106133
// Server panels
@@ -118,17 +145,29 @@ local commonlib = import 'common-lib/common/main.libsonnet';
118145
+ g.query.prometheus.withInterval('2m')
119146
+ g.query.prometheus.withIntervalFactor(2),
120147
])
148+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
149+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
150+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
121151
+ g.panel.timeSeries.standardOptions.withUnit('reqps')
122152
+ g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'),
123153

124154
serverRequestErrors:
125155
g.panel.timeSeries.new('Server request errors')
126156
+ g.panel.timeSeries.panelOptions.withDescription('The number of HTTP, FTP, and other server request errors.')
127157
+ g.panel.timeSeries.queryOptions.withTargets([
128-
signals.overview.serverFTPErrors.asTarget(),
129-
signals.overview.serverHTTPErrors.asTarget(),
130-
signals.overview.serverOtherErrors.asTarget(),
158+
signals.overview.serverFTPErrors.asTarget()
159+
+ g.query.prometheus.withInterval('2m')
160+
+ g.query.prometheus.withIntervalFactor(2),
161+
signals.overview.serverHTTPErrors.asTarget()
162+
+ g.query.prometheus.withInterval('2m')
163+
+ g.query.prometheus.withIntervalFactor(2),
164+
signals.overview.serverOtherErrors.asTarget()
165+
+ g.query.prometheus.withInterval('2m')
166+
+ g.query.prometheus.withIntervalFactor(2),
131167
])
168+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
169+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
170+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
132171
+ g.panel.timeSeries.standardOptions.withUnit('errors/s')
133172
+ g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'),
134173

@@ -146,6 +185,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
146185
+ g.query.prometheus.withInterval('2m')
147186
+ g.query.prometheus.withIntervalFactor(2),
148187
])
188+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
189+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
190+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
149191
+ g.panel.timeSeries.standardOptions.withUnit('KBs')
150192
+ g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'),
151193

@@ -160,6 +202,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
160202
+ g.query.prometheus.withInterval('2m')
161203
+ g.query.prometheus.withIntervalFactor(2),
162204
])
205+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
206+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
207+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
163208
+ g.panel.timeSeries.standardOptions.withUnit('cps')
164209
+ g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'),
165210

@@ -174,6 +219,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
174219
signals.overview.dnsLookups95.asTarget()
175220
+ g.query.prometheus.withIntervalFactor(2),
176221
])
222+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
223+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
224+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
177225
+ g.panel.timeSeries.standardOptions.withUnit('s')
178226
+ g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'),
179227

@@ -191,6 +239,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
191239
+ g.query.prometheus.withInterval('2m')
192240
+ g.query.prometheus.withIntervalFactor(2),
193241
])
242+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineInterpolation('smooth')
243+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withLineWidth(2)
244+
+ g.panel.timeSeries.fieldConfig.defaults.custom.withShowPoints('never')
194245
+ g.panel.timeSeries.standardOptions.withUnit('KBs')
195246
+ g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'),
196247
},

0 commit comments

Comments
 (0)