Skip to content

Commit eb341ae

Browse files
dashboard: add syncro queue panels
Add panels to "Replication overview" section to dashboard templates. Update consists of panels with following metrics: - tnt_synchro_queue_owner - tnt_synchro_queue_term - tnt_synchro_queue_len - tnt_synchro_queue_busy Part of #178
1 parent 34d1cd6 commit eb341ae

23 files changed

+17624
-8944
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- Panels for transaction operations
1212
- Panels with net statistics per thread
1313
- Panel with failover trigger count
14+
- Panels with syncro replication queue statistics
1415

1516
### Changed
1617
- Replace LuaJit deprecated metrics with new ones

dashboard/panels/replication.libsonnet

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,130 @@ local prometheus = grafana.prometheus;
137137
).where('metric_name', '=', 'tnt_clock_delta').where('label_pairs_alias', '=~', alias)
138138
.selectField('value').addConverter('last')
139139
),
140+
141+
local syncro_warning(description) = std.join(
142+
'\n',
143+
[description, |||
144+
Panel works with metrics 0.15.0 or newer, Tarantool 2.8.1 or newer.
145+
|||]
146+
),
147+
148+
synchro_queue_owner(
149+
title='Synchronous queue owner',
150+
description=syncro_warning(|||
151+
Instance ID of the current synchronous replication master.
152+
|||),
153+
datasource_type=null,
154+
datasource=null,
155+
policy=null,
156+
measurement=null,
157+
job=null,
158+
alias=null,
159+
):: common.default_graph(
160+
title=title,
161+
description=description,
162+
datasource=datasource,
163+
labelY1='owner id',
164+
decimals=0,
165+
panel_width=6,
166+
legend_avg=false,
167+
legend_max=false,
168+
).addTarget(common.default_metric_target(
169+
datasource_type,
170+
'tnt_synchro_queue_owner',
171+
job,
172+
policy,
173+
measurement,
174+
alias,
175+
)),
176+
177+
synchro_queue_term(
178+
title='Synchronous queue term',
179+
description=syncro_warning(|||
180+
Current queue term.
181+
|||),
182+
datasource_type=null,
183+
datasource=null,
184+
policy=null,
185+
measurement=null,
186+
job=null,
187+
alias=null,
188+
):: common.default_graph(
189+
title=title,
190+
description=description,
191+
datasource=datasource,
192+
labelY1='term',
193+
decimals=0,
194+
panel_width=6,
195+
legend_avg=false,
196+
legend_max=false,
197+
).addTarget(common.default_metric_target(
198+
datasource_type,
199+
'tnt_synchro_queue_term',
200+
job,
201+
policy,
202+
measurement,
203+
alias,
204+
)),
205+
206+
synchro_queue_length(
207+
title='Synchronous queue transactions',
208+
description=syncro_warning(|||
209+
Count of transactions collecting confirmations now.
210+
|||),
211+
datasource_type=null,
212+
datasource=null,
213+
policy=null,
214+
measurement=null,
215+
job=null,
216+
alias=null,
217+
):: common.default_graph(
218+
title=title,
219+
description=description,
220+
datasource=datasource,
221+
labelY1='current',
222+
panel_width=6,
223+
).addTarget(common.default_metric_target(
224+
datasource_type,
225+
'tnt_synchro_queue_len',
226+
job,
227+
policy,
228+
measurement,
229+
alias,
230+
)),
231+
232+
synchro_queue_busy(
233+
title='Synchronous queue busy',
234+
description=syncro_warning(|||
235+
Whether the queue is processing any system entry (CONFIRM/ROLLBACK/PROMOTE/DEMOTE).
236+
237+
Panel works with Grafana 8.x.
238+
|||),
239+
datasource_type=null,
240+
datasource=null,
241+
policy=null,
242+
measurement=null,
243+
job=null,
244+
alias=null,
245+
):: timeseries.new(
246+
title=title,
247+
description=description,
248+
datasource=datasource,
249+
panel_width=6,
250+
max=1,
251+
min=0,
252+
).addValueMapping(
253+
1, 'yellow', 'busy'
254+
).addValueMapping(
255+
0, 'green', 'not busy'
256+
).addRangeMapping(
257+
0.001, 0.999, '-'
258+
).addTarget(common.default_metric_target(
259+
datasource_type,
260+
'tnt_synchro_queue_busy',
261+
job,
262+
policy,
263+
measurement,
264+
alias,
265+
)),
140266
}

dashboard/section.libsonnet

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,42 @@ local tdg_tuples = import 'dashboard/panels/tdg/tuples.libsonnet';
165165
job=job,
166166
alias=alias,
167167
),
168+
169+
replication.synchro_queue_owner(
170+
datasource_type=datasource_type,
171+
datasource=datasource,
172+
policy=policy,
173+
measurement=measurement,
174+
job=job,
175+
alias=alias,
176+
),
177+
178+
replication.synchro_queue_term(
179+
datasource_type=datasource_type,
180+
datasource=datasource,
181+
policy=policy,
182+
measurement=measurement,
183+
job=job,
184+
alias=alias,
185+
),
186+
187+
replication.synchro_queue_length(
188+
datasource_type=datasource_type,
189+
datasource=datasource,
190+
policy=policy,
191+
measurement=measurement,
192+
job=job,
193+
alias=alias,
194+
),
195+
196+
replication.synchro_queue_busy(
197+
datasource_type=datasource_type,
198+
datasource=datasource,
199+
policy=policy,
200+
measurement=measurement,
201+
job=job,
202+
alias=alias,
203+
),
168204
],
169205

170206
http(datasource_type, datasource, policy=null, measurement=null, job=null, alias=null):: [

example_cluster/project/app/roles/storage.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
local function init(opts)
22
if opts.is_master then
3+
box.ctl.promote()
4+
35
for _, space_name in ipairs({'customers', 'clients'}) do
46
local space = box.schema.space.create(space_name, {
57
format = {
@@ -10,6 +12,7 @@ local function init(opts)
1012
},
1113
if_not_exists = true,
1214
engine = 'memtx',
15+
is_sync = true,
1316
})
1417
-- primary index
1518
space:create_index('id_index', {

supported_metrics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ Based on [tarantool/metrics 0.16.0](https://github.com/tarantool/metrics/release
121121
- [x] **tnt_cartridge_issues**: see *Cluster overview/Cartridge warning issues*, *Cluster overview/Cartridge critical issues* panels ([#55](https://github.com/tarantool/grafana-dashboard/pull/55))
122122
- **tnt_cartridge_cluster_issues**: unsupported (decided not to support: superseded by **tnt_cartridge_issues**)
123123
- [x] **tnt_cartridge_failover_trigger_total**: see *Cluster overview/Failovers triggered* panel ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
124-
- [ ] **tnt_synchro_queue_owner**: ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
125-
- [ ] **tnt_synchro_queue_term**: ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
126-
- [ ] **tnt_synchro_queue_len**: ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
127-
- [ ] **tnt_synchro_queue_busy**: ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
124+
- [x] **tnt_synchro_queue_owner**: see *Replication overview/Synchronous queue owner* panel ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
125+
- [x] **tnt_synchro_queue_term**: see *Replication overview/Synchronous queue term* panel ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
126+
- [x] **tnt_synchro_queue_len**: see *Replication overview/Synchronous queue transactions* panel ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
127+
- [x] **tnt_synchro_queue_busy**: see *Replication overview/Synchronous queue busy* panel ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
128128
- [ ] **tnt_election_state**: ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
129129
- [ ] **tnt_election_vote**: ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))
130130
- [ ] **tnt_election_leader**: ([#178](https://github.com/tarantool/grafana-dashboard/issues/178))

0 commit comments

Comments
 (0)