Skip to content

Commit 91ca428

Browse files
committed
Reworked signals to line up with dashboards
1 parent 2a668b3 commit 91ca428

File tree

8 files changed

+103
-466
lines changed

8 files changed

+103
-466
lines changed

squid-mixin/config.libsonnet

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
// Basic filtering
55
filteringSelector: 'job="integrations/squid"',
6-
groupLabels: ['job'],
7-
logLabels: ['job', 'instance'],
6+
groupLabels: ['job', 'cluster'],
7+
logLabels: ['job', 'cluster', 'instance'],
88
instanceLabels: ['instance'],
99

1010
// Dashboard settings
@@ -28,6 +28,6 @@
2828

2929
// Signal definitions
3030
signals: {
31-
client: (import './signals/client.libsonnet')(this),
31+
overview: (import './signals/overview.libsonnet')(this),
3232
},
3333
}

squid-mixin/dashboards_out/squid-logs.json

Lines changed: 19 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

squid-mixin/dashboards_out/squid-overview.json

Lines changed: 48 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

squid-mixin/g.libsonnet

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
// grafonnet must be imported with "g" alias
2-
local g = import './vendor/github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet';
3-
g
1+
import 'github.com/grafana/grafonnet/gen/grafonnet-v11.0.0/main.libsonnet'

squid-mixin/panels.libsonnet

Lines changed: 32 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
1111
g.panel.timeSeries.new('Client requests')
1212
+ g.panel.timeSeries.panelOptions.withDescription('The request rate of client.')
1313
+ g.panel.timeSeries.queryOptions.withTargets([
14-
signals.client.clientHTTPRequests.asTarget()
14+
signals.overview.clientHTTPRequests.asTarget()
1515
+ g.query.prometheus.withInterval('2m')
1616
+ g.query.prometheus.withIntervalFactor(2),
1717
])
@@ -21,7 +21,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
2121
g.panel.timeSeries.new('Client request errors')
2222
+ g.panel.timeSeries.panelOptions.withDescription('The number of client HTTP errors.')
2323
+ g.panel.timeSeries.queryOptions.withTargets([
24-
signals.client.clientHTTPErrors.asTarget()
24+
signals.overview.clientHTTPErrors.asTarget()
2525
+ g.query.prometheus.withInterval('2m')
2626
+ g.query.prometheus.withIntervalFactor(2),
2727
])
@@ -31,7 +31,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
3131
g.panel.timeSeries.new('Client cache hit ratio')
3232
+ g.panel.timeSeries.panelOptions.withDescription('The client cache hit ratio.')
3333
+ g.panel.timeSeries.queryOptions.withTargets([
34-
signals.client.clientCacheHitRatio.asTarget()
34+
signals.overview.clientCacheHitRatio.asTarget()
3535
+ g.query.prometheus.withInterval('2m')
3636
+ g.query.prometheus.withIntervalFactor(2),
3737
])
@@ -41,7 +41,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
4141
g.panel.timeSeries.new('Client request sent throughput')
4242
+ g.panel.timeSeries.panelOptions.withDescription('The throughput of client HTTP data sent.')
4343
+ g.panel.timeSeries.queryOptions.withTargets([
44-
signals.client.clientHTTPSentThroughput.asTarget()
44+
signals.overview.clientHTTPSentThroughput.asTarget()
4545
+ g.query.prometheus.withInterval('2m')
4646
+ g.query.prometheus.withIntervalFactor(2),
4747
])
@@ -51,7 +51,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
5151
g.panel.timeSeries.new('Client HTTP received throughput')
5252
+ g.panel.timeSeries.panelOptions.withDescription('The throughput of client HTTP data received.')
5353
+ g.panel.timeSeries.queryOptions.withTargets([
54-
signals.client.clientHTTPReceivedThroughput.asTarget()
54+
signals.overview.clientHTTPReceivedThroughput.asTarget()
5555
+ g.query.prometheus.withInterval('2m')
5656
+ g.query.prometheus.withIntervalFactor(2),
5757
])
@@ -61,7 +61,7 @@ local commonlib = import 'common-lib/common/main.libsonnet';
6161
g.panel.timeSeries.new('Client cache hit throughput')
6262
+ g.panel.timeSeries.panelOptions.withDescription('The throughput of client cache hit.')
6363
+ g.panel.timeSeries.queryOptions.withTargets([
64-
signals.client.clientCacheHitThroughput.asTarget()
64+
signals.overview.clientCacheHitThroughput.asTarget()
6565
+ g.query.prometheus.withInterval('2m')
6666
+ g.query.prometheus.withIntervalFactor(2),
6767
])
@@ -71,21 +71,21 @@ local commonlib = import 'common-lib/common/main.libsonnet';
7171
g.panel.timeSeries.new('HTTP request service time')
7272
+ g.panel.timeSeries.panelOptions.withDescription('HTTP request service time percentiles.')
7373
+ g.panel.timeSeries.queryOptions.withTargets([
74-
signals.client.httpRequestsAll50.asTarget(),
75-
signals.client.httpRequestsAll75.asTarget(),
76-
signals.client.httpRequestsAll95.asTarget(),
74+
signals.overview.httpRequestsAll50.asTarget(),
75+
signals.overview.httpRequestsAll75.asTarget(),
76+
signals.overview.httpRequestsAll95.asTarget(),
7777
])
7878
+ g.panel.timeSeries.standardOptions.withUnit('s'),
7979

8080
cacheHitServiceTime:
8181
g.panel.timeSeries.new('Cache hit service time')
8282
+ g.panel.timeSeries.panelOptions.withDescription('Cache hits service time percentiles.')
8383
+ g.panel.timeSeries.queryOptions.withTargets([
84-
signals.client.cacheHits50.asTarget()
84+
signals.overview.cacheHits50.asTarget()
8585
+ g.query.prometheus.withIntervalFactor(2),
86-
signals.client.cacheHits75.asTarget()
86+
signals.overview.cacheHits75.asTarget()
8787
+ g.query.prometheus.withIntervalFactor(2),
88-
signals.client.cacheHits95.asTarget()
88+
signals.overview.cacheHits95.asTarget()
8989
+ g.query.prometheus.withIntervalFactor(2),
9090
])
9191
+ g.panel.timeSeries.standardOptions.withUnit('s'),
@@ -94,11 +94,11 @@ local commonlib = import 'common-lib/common/main.libsonnet';
9494
g.panel.timeSeries.new('Cache misses service time')
9595
+ g.panel.timeSeries.panelOptions.withDescription('Cache misses service time percentiles.')
9696
+ g.panel.timeSeries.queryOptions.withTargets([
97-
signals.client.cacheMisses50.asTarget()
97+
signals.overview.cacheMisses50.asTarget()
9898
+ g.query.prometheus.withIntervalFactor(2),
99-
signals.client.cacheMisses75.asTarget()
99+
signals.overview.cacheMisses75.asTarget()
100100
+ g.query.prometheus.withIntervalFactor(2),
101-
signals.client.cacheMisses95.asTarget()
101+
signals.overview.cacheMisses95.asTarget()
102102
+ g.query.prometheus.withIntervalFactor(2),
103103
])
104104
+ g.panel.timeSeries.standardOptions.withUnit('s'),
@@ -108,13 +108,13 @@ local commonlib = import 'common-lib/common/main.libsonnet';
108108
g.panel.timeSeries.new('Server requests')
109109
+ g.panel.timeSeries.panelOptions.withDescription('The number of HTTP, FTP, and other server requests.')
110110
+ g.panel.timeSeries.queryOptions.withTargets([
111-
signals.client.serverFTPRequests.asTarget()
111+
signals.overview.serverFTPRequests.asTarget()
112112
+ g.query.prometheus.withInterval('2m')
113113
+ g.query.prometheus.withIntervalFactor(2),
114-
signals.client.serverHTTPRequests.asTarget()
114+
signals.overview.serverHTTPRequests.asTarget()
115115
+ g.query.prometheus.withInterval('2m')
116116
+ g.query.prometheus.withIntervalFactor(2),
117-
signals.client.serverOtherRequests.asTarget()
117+
signals.overview.serverOtherRequests.asTarget()
118118
+ g.query.prometheus.withInterval('2m')
119119
+ g.query.prometheus.withIntervalFactor(2),
120120
])
@@ -125,9 +125,9 @@ local commonlib = import 'common-lib/common/main.libsonnet';
125125
g.panel.timeSeries.new('Server request errors')
126126
+ g.panel.timeSeries.panelOptions.withDescription('The number of HTTP, FTP, and other server request errors.')
127127
+ g.panel.timeSeries.queryOptions.withTargets([
128-
signals.client.serverFTPErrors.asTarget(),
129-
signals.client.serverHTTPErrors.asTarget(),
130-
signals.client.serverOtherErrors.asTarget(),
128+
signals.overview.serverFTPErrors.asTarget(),
129+
signals.overview.serverHTTPErrors.asTarget(),
130+
signals.overview.serverOtherErrors.asTarget(),
131131
])
132132
+ g.panel.timeSeries.standardOptions.withUnit('errors/s')
133133
+ g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'),
@@ -136,13 +136,13 @@ local commonlib = import 'common-lib/common/main.libsonnet';
136136
g.panel.timeSeries.new('Server request sent throughput')
137137
+ g.panel.timeSeries.panelOptions.withDescription('The number of HTTP, FTP, and other server sent throughput.')
138138
+ g.panel.timeSeries.queryOptions.withTargets([
139-
signals.client.serverFTPSentThroughput.asTarget()
139+
signals.overview.serverFTPSentThroughput.asTarget()
140140
+ g.query.prometheus.withInterval('2m')
141141
+ g.query.prometheus.withIntervalFactor(2),
142-
signals.client.serverHTTPSentThroughput.asTarget()
142+
signals.overview.serverHTTPSentThroughput.asTarget()
143143
+ g.query.prometheus.withInterval('2m')
144144
+ g.query.prometheus.withIntervalFactor(2),
145-
signals.client.serverOtherSentThroughput.asTarget()
145+
signals.overview.serverOtherSentThroughput.asTarget()
146146
+ g.query.prometheus.withInterval('2m')
147147
+ g.query.prometheus.withIntervalFactor(2),
148148
])
@@ -153,10 +153,10 @@ local commonlib = import 'common-lib/common/main.libsonnet';
153153
g.panel.timeSeries.new('Server object swap')
154154
+ g.panel.timeSeries.panelOptions.withDescription('The number of objects read from disk and the number of objects saved to disk.')
155155
+ g.panel.timeSeries.queryOptions.withTargets([
156-
signals.client.swapIns.asTarget()
156+
signals.overview.swapIns.asTarget()
157157
+ g.query.prometheus.withInterval('2m')
158158
+ g.query.prometheus.withIntervalFactor(2),
159-
signals.client.swapOuts.asTarget()
159+
signals.overview.swapOuts.asTarget()
160160
+ g.query.prometheus.withInterval('2m')
161161
+ g.query.prometheus.withIntervalFactor(2),
162162
])
@@ -167,11 +167,11 @@ local commonlib = import 'common-lib/common/main.libsonnet';
167167
g.panel.timeSeries.new('DNS lookup service time')
168168
+ g.panel.timeSeries.panelOptions.withDescription('DNS lookup service time percentiles')
169169
+ g.panel.timeSeries.queryOptions.withTargets([
170-
signals.client.dnsLookups50.asTarget()
170+
signals.overview.dnsLookups50.asTarget()
171171
+ g.query.prometheus.withIntervalFactor(2),
172-
signals.client.dnsLookups75.asTarget()
172+
signals.overview.dnsLookups75.asTarget()
173173
+ g.query.prometheus.withIntervalFactor(2),
174-
signals.client.dnsLookups95.asTarget()
174+
signals.overview.dnsLookups95.asTarget()
175175
+ g.query.prometheus.withIntervalFactor(2),
176176
])
177177
+ g.panel.timeSeries.standardOptions.withUnit('s')
@@ -181,46 +181,17 @@ local commonlib = import 'common-lib/common/main.libsonnet';
181181
g.panel.timeSeries.new('Server received throughput')
182182
+ g.panel.timeSeries.panelOptions.withDescription('The number of HTTP, FTP, and other server throughput.')
183183
+ g.panel.timeSeries.queryOptions.withTargets([
184-
signals.client.serverFTPReceivedThroughput.asTarget()
184+
signals.overview.serverFTPReceivedThroughput.asTarget()
185185
+ g.query.prometheus.withInterval('2m')
186186
+ g.query.prometheus.withIntervalFactor(2),
187-
signals.client.serverHTTPReceivedThroughput.asTarget()
187+
signals.overview.serverHTTPReceivedThroughput.asTarget()
188188
+ g.query.prometheus.withInterval('2m')
189189
+ g.query.prometheus.withIntervalFactor(2),
190-
signals.client.serverOtherReceivedThroughput.asTarget()
190+
signals.overview.serverOtherReceivedThroughput.asTarget()
191191
+ g.query.prometheus.withInterval('2m')
192192
+ g.query.prometheus.withIntervalFactor(2),
193193
])
194194
+ g.panel.timeSeries.standardOptions.withUnit('KBs')
195195
+ g.panel.timeSeries.fieldConfig.defaults.custom.stacking.withMode('normal'),
196-
197-
// Logs panels
198-
// cacheLogs:
199-
// g.panel.logs.new('Cache logs')
200-
// + g.panel.logs.panelOptions.withDescription('The log file that contains the debug and error messages that Squid generates.')
201-
// + g.panel.logs.queryOptions.withTargets([
202-
// g.query.loki.new(
203-
// '${loki_datasource}',
204-
// '{' + this.config.filteringSelector + '} |= `` | (filename="/var/log/squid/cache.log" or log_type="cache")'
205-
// ),
206-
// ])
207-
// + g.panel.logs.options.withEnableLogDetails(true)
208-
// + g.panel.logs.options.withShowCommonLabels(false)
209-
// + g.panel.logs.options.withShowTime(false)
210-
// + g.panel.logs.options.withWrapLogMessage(false),
211-
212-
// accessLogs:
213-
// g.panel.logs.new('Access logs')
214-
// + g.panel.logs.panelOptions.withDescription('The log file that contains a record of all HTTP requests and responses processed by the Squid proxy server.')
215-
// + g.panel.logs.queryOptions.withTargets([
216-
// g.query.loki.new(
217-
// '${loki_datasource}',
218-
// '{' + this.config.filteringSelector + '} |= `` | (filename="/var/log/squid/access.log" or log_type="access")'
219-
// ),
220-
// ])
221-
// + g.panel.logs.options.withEnableLogDetails(true)
222-
// + g.panel.logs.options.withShowCommonLabels(false)
223-
// + g.panel.logs.options.withShowTime(false)
224-
// + g.panel.logs.options.withWrapLogMessage(false),
225196
},
226197
}
File renamed without changes.

0 commit comments

Comments
 (0)