lepus 0.0.1.beta2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/linter.yml +21 -0
- data/.github/workflows/specs.yml +93 -13
- data/.gitignore +2 -0
- data/.rubocop.yml +10 -0
- data/.tool-versions +1 -1
- data/Gemfile +7 -0
- data/Gemfile.lock +36 -9
- data/Makefile +19 -0
- data/README.md +562 -7
- data/bin/setup +5 -2
- data/config.ru +14 -0
- data/docker-compose.yml +5 -3
- data/docs/README.md +80 -0
- data/docs/cli.md +108 -0
- data/docs/configuration.md +171 -0
- data/docs/consumers.md +168 -0
- data/docs/getting-started.md +136 -0
- data/docs/images/lepus-web.png +0 -0
- data/docs/middleware.md +240 -0
- data/docs/producers.md +173 -0
- data/docs/prometheus.md +112 -0
- data/docs/rails.md +161 -0
- data/docs/supervisor.md +112 -0
- data/docs/testing.md +141 -0
- data/docs/web.md +85 -0
- data/examples/grafana-dashboard.json +450 -0
- data/gemfiles/Gemfile.rails-5.2 +7 -0
- data/gemfiles/{rails52.gemfile.lock → Gemfile.rails-5.2.lock} +102 -69
- data/gemfiles/Gemfile.rails-6.1 +7 -0
- data/gemfiles/{rails61.gemfile.lock → Gemfile.rails-6.1.lock} +113 -79
- data/gemfiles/{rails52.gemfile → Gemfile.rails-7.2} +1 -1
- data/gemfiles/Gemfile.rails-7.2.lock +321 -0
- data/gemfiles/{rails61.gemfile → Gemfile.rails-8.0} +1 -1
- data/gemfiles/Gemfile.rails-8.0.lock +322 -0
- data/lepus.gemspec +7 -1
- data/lib/lepus/cli.rb +35 -4
- data/lib/lepus/configuration.rb +107 -0
- data/lib/lepus/connection_pool.rb +135 -0
- data/lib/lepus/consumer.rb +59 -41
- data/lib/lepus/consumers/config.rb +183 -0
- data/lib/lepus/consumers/handler.rb +56 -0
- data/lib/lepus/consumers/middleware_chain.rb +22 -0
- data/lib/lepus/consumers/middlewares/exception_logger.rb +27 -0
- data/lib/lepus/consumers/middlewares/honeybadger.rb +33 -0
- data/lib/lepus/consumers/middlewares/json.rb +37 -0
- data/lib/lepus/consumers/middlewares/max_retry.rb +83 -0
- data/lib/lepus/consumers/middlewares/unique.rb +65 -0
- data/lib/lepus/consumers/stats.rb +70 -0
- data/lib/lepus/consumers/stats_registry.rb +29 -0
- data/lib/lepus/consumers/worker.rb +141 -0
- data/lib/lepus/consumers/worker_factory.rb +124 -0
- data/lib/lepus/consumers.rb +6 -0
- data/lib/lepus/message/delivery_info.rb +72 -0
- data/lib/lepus/message/metadata.rb +99 -0
- data/lib/lepus/message.rb +88 -5
- data/lib/lepus/middleware_chain.rb +83 -0
- data/lib/lepus/primitive/hash.rb +29 -0
- data/lib/lepus/process.rb +24 -24
- data/lib/lepus/process_registry/backend.rb +49 -0
- data/lib/lepus/process_registry/file_backend.rb +108 -0
- data/lib/lepus/process_registry/message_builder.rb +72 -0
- data/lib/lepus/process_registry/rabbitmq_backend.rb +153 -0
- data/lib/lepus/process_registry.rb +56 -23
- data/lib/lepus/processes/base.rb +0 -5
- data/lib/lepus/processes/callbacks.rb +3 -0
- data/lib/lepus/processes/interruptible.rb +4 -8
- data/lib/lepus/processes/procline.rb +1 -1
- data/lib/lepus/processes/registrable.rb +1 -1
- data/lib/lepus/processes/runnable.rb +1 -1
- data/lib/lepus/processes.rb +15 -0
- data/lib/lepus/producer.rb +141 -30
- data/lib/lepus/producers/config.rb +46 -0
- data/lib/lepus/producers/definition.rb +48 -0
- data/lib/lepus/producers/hooks.rb +170 -0
- data/lib/lepus/producers/middleware_chain.rb +22 -0
- data/lib/lepus/producers/middlewares/correlation_id.rb +37 -0
- data/lib/lepus/producers/middlewares/header.rb +47 -0
- data/lib/lepus/producers/middlewares/instrumentation.rb +30 -0
- data/lib/lepus/producers/middlewares/json.rb +47 -0
- data/lib/lepus/producers/middlewares/unique.rb +67 -0
- data/lib/lepus/producers.rb +7 -0
- data/lib/lepus/prometheus/collector.rb +149 -0
- data/lib/lepus/prometheus/instrumentation.rb +168 -0
- data/lib/lepus/prometheus.rb +48 -0
- data/lib/lepus/publisher.rb +67 -0
- data/lib/lepus/supervisor/children_pipes.rb +25 -0
- data/lib/lepus/supervisor/lifecycle_hooks.rb +50 -0
- data/lib/lepus/supervisor/pidfiled.rb +1 -1
- data/lib/lepus/supervisor/registry_cleaner.rb +22 -0
- data/lib/lepus/supervisor.rb +129 -25
- data/lib/lepus/testing/exchange.rb +95 -0
- data/lib/lepus/testing/message_builder.rb +177 -0
- data/lib/lepus/testing/rspec_matchers.rb +258 -0
- data/lib/lepus/testing.rb +210 -0
- data/lib/lepus/unique.rb +18 -0
- data/lib/lepus/version.rb +1 -1
- data/lib/lepus/web/aggregator.rb +154 -0
- data/lib/lepus/web/api.rb +132 -0
- data/lib/lepus/web/app.rb +37 -0
- data/lib/lepus/web/management_api.rb +192 -0
- data/lib/lepus/web/respond_with.rb +28 -0
- data/lib/lepus/web.rb +238 -0
- data/lib/lepus.rb +39 -28
- data/test_offline.html +189 -0
- data/web/assets/css/styles.css +635 -0
- data/web/assets/js/app.js +6 -0
- data/web/assets/js/bootstrap.js +20 -0
- data/web/assets/js/controllers/connection_controller.js +44 -0
- data/web/assets/js/controllers/dashboard_controller.js +499 -0
- data/web/assets/js/controllers/queue_controller.js +17 -0
- data/web/assets/js/controllers/theme_controller.js +31 -0
- data/web/assets/js/offline-manager.js +233 -0
- data/web/assets/js/service-worker-manager.js +65 -0
- data/web/index.html +159 -0
- data/web/sw.js +144 -0
- metadata +177 -18
- data/lib/lepus/consumer_config.rb +0 -149
- data/lib/lepus/consumer_wrapper.rb +0 -46
- data/lib/lepus/lifecycle_hooks.rb +0 -49
- data/lib/lepus/middlewares/honeybadger.rb +0 -23
- data/lib/lepus/middlewares/json.rb +0 -35
- data/lib/lepus/middlewares/max_retry.rb +0 -57
- data/lib/lepus/processes/consumer.rb +0 -113
- data/lib/lepus/supervisor/config.rb +0 -45
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
{
|
|
2
|
+
"annotations": {
|
|
3
|
+
"list": [
|
|
4
|
+
{
|
|
5
|
+
"builtIn": 1,
|
|
6
|
+
"datasource": {
|
|
7
|
+
"type": "grafana",
|
|
8
|
+
"uid": "-- Grafana --"
|
|
9
|
+
},
|
|
10
|
+
"enable": true,
|
|
11
|
+
"hide": true,
|
|
12
|
+
"iconColor": "rgba(0, 211, 255, 1)",
|
|
13
|
+
"name": "Annotations & Alerts",
|
|
14
|
+
"type": "dashboard"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"description": "Lepus RabbitMQ consumers/producer dashboard. Reads metrics exposed by the `lepus/prometheus/collector` running inside a prometheus_exporter process.",
|
|
19
|
+
"editable": true,
|
|
20
|
+
"fiscalYearStartMonth": 0,
|
|
21
|
+
"graphTooltip": 1,
|
|
22
|
+
"id": null,
|
|
23
|
+
"links": [],
|
|
24
|
+
"liveNow": false,
|
|
25
|
+
"panels": [
|
|
26
|
+
{
|
|
27
|
+
"collapsed": false,
|
|
28
|
+
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 0},
|
|
29
|
+
"id": 100,
|
|
30
|
+
"panels": [],
|
|
31
|
+
"title": "Throughput",
|
|
32
|
+
"type": "row"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
36
|
+
"description": "Per-consumer delivery rate, split by outcome (ack / reject / nack / requeue).",
|
|
37
|
+
"fieldConfig": {
|
|
38
|
+
"defaults": {
|
|
39
|
+
"color": {"mode": "palette-classic"},
|
|
40
|
+
"custom": {
|
|
41
|
+
"axisCenteredZero": false,
|
|
42
|
+
"axisColorMode": "text",
|
|
43
|
+
"axisLabel": "msg/s",
|
|
44
|
+
"axisPlacement": "auto",
|
|
45
|
+
"barAlignment": 0,
|
|
46
|
+
"drawStyle": "line",
|
|
47
|
+
"fillOpacity": 10,
|
|
48
|
+
"gradientMode": "opacity",
|
|
49
|
+
"lineInterpolation": "smooth",
|
|
50
|
+
"lineWidth": 2,
|
|
51
|
+
"pointSize": 4,
|
|
52
|
+
"scaleDistribution": {"type": "linear"},
|
|
53
|
+
"showPoints": "never",
|
|
54
|
+
"spanNulls": false,
|
|
55
|
+
"stacking": {"group": "A", "mode": "normal"}
|
|
56
|
+
},
|
|
57
|
+
"unit": "cps"
|
|
58
|
+
},
|
|
59
|
+
"overrides": []
|
|
60
|
+
},
|
|
61
|
+
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 1},
|
|
62
|
+
"id": 1,
|
|
63
|
+
"options": {
|
|
64
|
+
"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true},
|
|
65
|
+
"tooltip": {"mode": "multi", "sort": "desc"}
|
|
66
|
+
},
|
|
67
|
+
"targets": [
|
|
68
|
+
{
|
|
69
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
70
|
+
"expr": "sum by (consumer, result) (rate(lepus_messages_processed_total[$__rate_interval]))",
|
|
71
|
+
"legendFormat": "{{consumer}} · {{result}}",
|
|
72
|
+
"refId": "A"
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"title": "Consumer throughput",
|
|
76
|
+
"type": "timeseries"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
80
|
+
"description": "Per-exchange publish rate.",
|
|
81
|
+
"fieldConfig": {
|
|
82
|
+
"defaults": {
|
|
83
|
+
"color": {"mode": "palette-classic"},
|
|
84
|
+
"custom": {
|
|
85
|
+
"axisLabel": "msg/s",
|
|
86
|
+
"drawStyle": "line",
|
|
87
|
+
"fillOpacity": 10,
|
|
88
|
+
"lineInterpolation": "smooth",
|
|
89
|
+
"lineWidth": 2,
|
|
90
|
+
"stacking": {"group": "A", "mode": "normal"}
|
|
91
|
+
},
|
|
92
|
+
"unit": "cps"
|
|
93
|
+
},
|
|
94
|
+
"overrides": []
|
|
95
|
+
},
|
|
96
|
+
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 1},
|
|
97
|
+
"id": 2,
|
|
98
|
+
"options": {
|
|
99
|
+
"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true},
|
|
100
|
+
"tooltip": {"mode": "multi", "sort": "desc"}
|
|
101
|
+
},
|
|
102
|
+
"targets": [
|
|
103
|
+
{
|
|
104
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
105
|
+
"expr": "sum by (exchange) (rate(lepus_messages_published_total[$__rate_interval]))",
|
|
106
|
+
"legendFormat": "{{exchange}}",
|
|
107
|
+
"refId": "A"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"title": "Publish throughput",
|
|
111
|
+
"type": "timeseries"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
115
|
+
"description": "Share of failed deliveries (reject / nack / requeue) over total delivered.",
|
|
116
|
+
"fieldConfig": {
|
|
117
|
+
"defaults": {
|
|
118
|
+
"color": {"mode": "thresholds"},
|
|
119
|
+
"mappings": [],
|
|
120
|
+
"max": 1,
|
|
121
|
+
"min": 0,
|
|
122
|
+
"thresholds": {
|
|
123
|
+
"mode": "percentage",
|
|
124
|
+
"steps": [
|
|
125
|
+
{"color": "green", "value": null},
|
|
126
|
+
{"color": "yellow", "value": 1},
|
|
127
|
+
{"color": "red", "value": 5}
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"unit": "percentunit"
|
|
131
|
+
},
|
|
132
|
+
"overrides": []
|
|
133
|
+
},
|
|
134
|
+
"gridPos": {"h": 6, "w": 8, "x": 0, "y": 9},
|
|
135
|
+
"id": 3,
|
|
136
|
+
"options": {
|
|
137
|
+
"colorMode": "value",
|
|
138
|
+
"graphMode": "area",
|
|
139
|
+
"justifyMode": "auto",
|
|
140
|
+
"orientation": "horizontal",
|
|
141
|
+
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
|
|
142
|
+
"textMode": "auto"
|
|
143
|
+
},
|
|
144
|
+
"targets": [
|
|
145
|
+
{
|
|
146
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
147
|
+
"expr": "sum(rate(lepus_messages_processed_total{result!=\"ack\"}[$__rate_interval])) / clamp_min(sum(rate(lepus_messages_processed_total[$__rate_interval])), 1)",
|
|
148
|
+
"legendFormat": "failure ratio",
|
|
149
|
+
"refId": "A"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"title": "Failure ratio (non-ack / total)",
|
|
153
|
+
"type": "stat"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
157
|
+
"description": "p50/p95/p99 message delivery latency (time spent in consumer).",
|
|
158
|
+
"fieldConfig": {
|
|
159
|
+
"defaults": {
|
|
160
|
+
"color": {"mode": "palette-classic"},
|
|
161
|
+
"custom": {
|
|
162
|
+
"axisLabel": "seconds",
|
|
163
|
+
"drawStyle": "line",
|
|
164
|
+
"fillOpacity": 5,
|
|
165
|
+
"lineInterpolation": "smooth",
|
|
166
|
+
"lineWidth": 2
|
|
167
|
+
},
|
|
168
|
+
"unit": "s"
|
|
169
|
+
},
|
|
170
|
+
"overrides": []
|
|
171
|
+
},
|
|
172
|
+
"gridPos": {"h": 6, "w": 16, "x": 8, "y": 9},
|
|
173
|
+
"id": 4,
|
|
174
|
+
"options": {
|
|
175
|
+
"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true},
|
|
176
|
+
"tooltip": {"mode": "multi", "sort": "desc"}
|
|
177
|
+
},
|
|
178
|
+
"targets": [
|
|
179
|
+
{
|
|
180
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
181
|
+
"expr": "histogram_quantile(0.50, sum by (le, consumer) (rate(lepus_delivery_duration_seconds_bucket[$__rate_interval])))",
|
|
182
|
+
"legendFormat": "p50 {{consumer}}",
|
|
183
|
+
"refId": "A"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
187
|
+
"expr": "histogram_quantile(0.95, sum by (le, consumer) (rate(lepus_delivery_duration_seconds_bucket[$__rate_interval])))",
|
|
188
|
+
"legendFormat": "p95 {{consumer}}",
|
|
189
|
+
"refId": "B"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
193
|
+
"expr": "histogram_quantile(0.99, sum by (le, consumer) (rate(lepus_delivery_duration_seconds_bucket[$__rate_interval])))",
|
|
194
|
+
"legendFormat": "p99 {{consumer}}",
|
|
195
|
+
"refId": "C"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"title": "Delivery latency (consumer processing time)",
|
|
199
|
+
"type": "timeseries"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"collapsed": false,
|
|
203
|
+
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 15},
|
|
204
|
+
"id": 101,
|
|
205
|
+
"panels": [],
|
|
206
|
+
"title": "Queues",
|
|
207
|
+
"type": "row"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
211
|
+
"description": "Backlog per queue: messages ready to be delivered.",
|
|
212
|
+
"fieldConfig": {
|
|
213
|
+
"defaults": {
|
|
214
|
+
"color": {"mode": "palette-classic"},
|
|
215
|
+
"custom": {
|
|
216
|
+
"drawStyle": "line",
|
|
217
|
+
"fillOpacity": 15,
|
|
218
|
+
"lineInterpolation": "stepAfter",
|
|
219
|
+
"lineWidth": 2
|
|
220
|
+
},
|
|
221
|
+
"unit": "short"
|
|
222
|
+
},
|
|
223
|
+
"overrides": []
|
|
224
|
+
},
|
|
225
|
+
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 16},
|
|
226
|
+
"id": 5,
|
|
227
|
+
"options": {
|
|
228
|
+
"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true},
|
|
229
|
+
"tooltip": {"mode": "multi", "sort": "desc"}
|
|
230
|
+
},
|
|
231
|
+
"targets": [
|
|
232
|
+
{
|
|
233
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
234
|
+
"expr": "lepus_queue_messages_ready",
|
|
235
|
+
"legendFormat": "{{name}}",
|
|
236
|
+
"refId": "A"
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
"title": "Messages ready",
|
|
240
|
+
"type": "timeseries"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
244
|
+
"description": "Messages delivered but not yet acknowledged (in-flight).",
|
|
245
|
+
"fieldConfig": {
|
|
246
|
+
"defaults": {
|
|
247
|
+
"color": {"mode": "palette-classic"},
|
|
248
|
+
"custom": {
|
|
249
|
+
"drawStyle": "line",
|
|
250
|
+
"fillOpacity": 15,
|
|
251
|
+
"lineInterpolation": "stepAfter",
|
|
252
|
+
"lineWidth": 2
|
|
253
|
+
},
|
|
254
|
+
"unit": "short"
|
|
255
|
+
},
|
|
256
|
+
"overrides": []
|
|
257
|
+
},
|
|
258
|
+
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 16},
|
|
259
|
+
"id": 6,
|
|
260
|
+
"options": {
|
|
261
|
+
"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true},
|
|
262
|
+
"tooltip": {"mode": "multi", "sort": "desc"}
|
|
263
|
+
},
|
|
264
|
+
"targets": [
|
|
265
|
+
{
|
|
266
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
267
|
+
"expr": "lepus_queue_messages_unacknowledged",
|
|
268
|
+
"legendFormat": "{{name}}",
|
|
269
|
+
"refId": "A"
|
|
270
|
+
}
|
|
271
|
+
],
|
|
272
|
+
"title": "Messages unacknowledged",
|
|
273
|
+
"type": "timeseries"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
277
|
+
"description": "Active consumer count per queue.",
|
|
278
|
+
"fieldConfig": {
|
|
279
|
+
"defaults": {
|
|
280
|
+
"color": {"mode": "palette-classic"},
|
|
281
|
+
"custom": {
|
|
282
|
+
"drawStyle": "line",
|
|
283
|
+
"fillOpacity": 5,
|
|
284
|
+
"lineInterpolation": "stepAfter",
|
|
285
|
+
"lineWidth": 2
|
|
286
|
+
},
|
|
287
|
+
"unit": "short"
|
|
288
|
+
},
|
|
289
|
+
"overrides": []
|
|
290
|
+
},
|
|
291
|
+
"gridPos": {"h": 8, "w": 12, "x": 0, "y": 24},
|
|
292
|
+
"id": 7,
|
|
293
|
+
"options": {
|
|
294
|
+
"legend": {"calcs": ["last"], "displayMode": "table", "placement": "right", "showLegend": true},
|
|
295
|
+
"tooltip": {"mode": "multi", "sort": "desc"}
|
|
296
|
+
},
|
|
297
|
+
"targets": [
|
|
298
|
+
{
|
|
299
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
300
|
+
"expr": "lepus_queue_consumers",
|
|
301
|
+
"legendFormat": "{{name}}",
|
|
302
|
+
"refId": "A"
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
"title": "Consumers per queue",
|
|
306
|
+
"type": "timeseries"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
310
|
+
"description": "RabbitMQ queue memory usage.",
|
|
311
|
+
"fieldConfig": {
|
|
312
|
+
"defaults": {
|
|
313
|
+
"color": {"mode": "palette-classic"},
|
|
314
|
+
"custom": {
|
|
315
|
+
"drawStyle": "line",
|
|
316
|
+
"fillOpacity": 5,
|
|
317
|
+
"lineInterpolation": "smooth",
|
|
318
|
+
"lineWidth": 2
|
|
319
|
+
},
|
|
320
|
+
"unit": "bytes"
|
|
321
|
+
},
|
|
322
|
+
"overrides": []
|
|
323
|
+
},
|
|
324
|
+
"gridPos": {"h": 8, "w": 12, "x": 12, "y": 24},
|
|
325
|
+
"id": 8,
|
|
326
|
+
"options": {
|
|
327
|
+
"legend": {"calcs": ["last", "max"], "displayMode": "table", "placement": "right", "showLegend": true},
|
|
328
|
+
"tooltip": {"mode": "multi", "sort": "desc"}
|
|
329
|
+
},
|
|
330
|
+
"targets": [
|
|
331
|
+
{
|
|
332
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
333
|
+
"expr": "lepus_queue_memory_bytes",
|
|
334
|
+
"legendFormat": "{{name}}",
|
|
335
|
+
"refId": "A"
|
|
336
|
+
}
|
|
337
|
+
],
|
|
338
|
+
"title": "Queue memory",
|
|
339
|
+
"type": "timeseries"
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"collapsed": false,
|
|
343
|
+
"gridPos": {"h": 1, "w": 24, "x": 0, "y": 32},
|
|
344
|
+
"id": 102,
|
|
345
|
+
"panels": [],
|
|
346
|
+
"title": "Processes",
|
|
347
|
+
"type": "row"
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
351
|
+
"description": "RSS memory per Lepus process (worker / supervisor).",
|
|
352
|
+
"fieldConfig": {
|
|
353
|
+
"defaults": {
|
|
354
|
+
"color": {"mode": "palette-classic"},
|
|
355
|
+
"custom": {
|
|
356
|
+
"drawStyle": "line",
|
|
357
|
+
"fillOpacity": 10,
|
|
358
|
+
"lineInterpolation": "smooth",
|
|
359
|
+
"lineWidth": 2
|
|
360
|
+
},
|
|
361
|
+
"unit": "bytes"
|
|
362
|
+
},
|
|
363
|
+
"overrides": []
|
|
364
|
+
},
|
|
365
|
+
"gridPos": {"h": 8, "w": 16, "x": 0, "y": 33},
|
|
366
|
+
"id": 9,
|
|
367
|
+
"options": {
|
|
368
|
+
"legend": {"calcs": ["mean", "max"], "displayMode": "table", "placement": "right", "showLegend": true},
|
|
369
|
+
"tooltip": {"mode": "multi", "sort": "desc"}
|
|
370
|
+
},
|
|
371
|
+
"targets": [
|
|
372
|
+
{
|
|
373
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
374
|
+
"expr": "lepus_process_rss_memory_bytes",
|
|
375
|
+
"legendFormat": "{{kind}} {{name}} · pid {{pid}}",
|
|
376
|
+
"refId": "A"
|
|
377
|
+
}
|
|
378
|
+
],
|
|
379
|
+
"title": "Process RSS memory",
|
|
380
|
+
"type": "timeseries"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
384
|
+
"description": "Running Lepus processes by kind.",
|
|
385
|
+
"fieldConfig": {
|
|
386
|
+
"defaults": {
|
|
387
|
+
"color": {"mode": "thresholds"},
|
|
388
|
+
"mappings": [],
|
|
389
|
+
"thresholds": {
|
|
390
|
+
"mode": "absolute",
|
|
391
|
+
"steps": [
|
|
392
|
+
{"color": "red", "value": null},
|
|
393
|
+
{"color": "green", "value": 1}
|
|
394
|
+
]
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
"overrides": []
|
|
398
|
+
},
|
|
399
|
+
"gridPos": {"h": 8, "w": 8, "x": 16, "y": 33},
|
|
400
|
+
"id": 10,
|
|
401
|
+
"options": {
|
|
402
|
+
"colorMode": "value",
|
|
403
|
+
"graphMode": "area",
|
|
404
|
+
"justifyMode": "auto",
|
|
405
|
+
"orientation": "auto",
|
|
406
|
+
"reduceOptions": {"calcs": ["lastNotNull"], "fields": "", "values": false},
|
|
407
|
+
"textMode": "value_and_name"
|
|
408
|
+
},
|
|
409
|
+
"targets": [
|
|
410
|
+
{
|
|
411
|
+
"datasource": {"type": "prometheus", "uid": "${DS_PROMETHEUS}"},
|
|
412
|
+
"expr": "count by (kind) (lepus_process_rss_memory_bytes)",
|
|
413
|
+
"legendFormat": "{{kind}}",
|
|
414
|
+
"refId": "A"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
"title": "Processes by kind",
|
|
418
|
+
"type": "stat"
|
|
419
|
+
}
|
|
420
|
+
],
|
|
421
|
+
"refresh": "30s",
|
|
422
|
+
"schemaVersion": 38,
|
|
423
|
+
"style": "dark",
|
|
424
|
+
"tags": ["lepus", "rabbitmq", "ruby"],
|
|
425
|
+
"templating": {
|
|
426
|
+
"list": [
|
|
427
|
+
{
|
|
428
|
+
"current": {"selected": false, "text": "Prometheus", "value": "Prometheus"},
|
|
429
|
+
"hide": 0,
|
|
430
|
+
"includeAll": false,
|
|
431
|
+
"label": "Prometheus",
|
|
432
|
+
"multi": false,
|
|
433
|
+
"name": "DS_PROMETHEUS",
|
|
434
|
+
"options": [],
|
|
435
|
+
"query": "prometheus",
|
|
436
|
+
"refresh": 1,
|
|
437
|
+
"regex": "",
|
|
438
|
+
"skipUrlSync": false,
|
|
439
|
+
"type": "datasource"
|
|
440
|
+
}
|
|
441
|
+
]
|
|
442
|
+
},
|
|
443
|
+
"time": {"from": "now-1h", "to": "now"},
|
|
444
|
+
"timepicker": {},
|
|
445
|
+
"timezone": "",
|
|
446
|
+
"title": "Lepus",
|
|
447
|
+
"uid": "lepus-overview",
|
|
448
|
+
"version": 1,
|
|
449
|
+
"weekStart": ""
|
|
450
|
+
}
|