Skip to content

Commit

Permalink
dashboard: add read only status panel
Browse files Browse the repository at this point in the history
Add master/slave status panel to a cluster overview section.
tnt_read_only metric was introduced in 0.11.0.

Part of #133
  • Loading branch information
DifferentialOrange committed May 5, 2022
1 parent 27e38be commit 2b258ea
Show file tree
Hide file tree
Showing 7 changed files with 960 additions and 393 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Vinyl index and bloom filter memory panels
- Clock delta panel
- Replication status panel and alert example
- Read only status panel

### Changed
- Rework "Tarantool memory memory miscellaneous" section to "Tarantool runtime overview"
Expand Down
39 changes: 38 additions & 1 deletion dashboard/panels/cluster.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ local prometheus = grafana.prometheus;
title=title,
description=description,
datasource=datasource,
panel_width=24,
panel_width=12,
max=1,
min=0,
).addValueMapping(
Expand All @@ -417,6 +417,43 @@ local prometheus = grafana.prometheus;
.selectField('value').addConverter('last')
),

read_only_status(
title='Tarantool instance status',
description=|||
`master` status means instance is available for read and
write operations. `slave` status means instance is
available only for read operations.
Panel works with `metrics >= 0.11.0` and Grafana 8.x.
|||,
datasource=null,
policy=null,
measurement=null,
job=null,
):: timeseries.new(
title=title,
description=description,
datasource=datasource,
panel_width=12,
max=1,
min=0,
).addValueMapping(
0, 'green', 'master'
).addValueMapping(
1, 'yellow', 'slave'
).addRangeMapping(
0.001, 0.999, '-'
).addTarget(
common.default_metric_target(
datasource,
'tnt_read_only',
job,
policy,
measurement,
'last'
)
),

replication_lag(
title='Tarantool replication lag',
description=|||
Expand Down
11 changes: 11 additions & 0 deletions dashboard/section.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ local vinyl = import 'panels/vinyl.libsonnet';
measurement=measurement,
),

cluster.read_only_status(
datasource=datasource,
policy=policy,
measurement=measurement,
),

cluster.replication_lag(
datasource=datasource,
policy=policy,
Expand Down Expand Up @@ -101,6 +107,11 @@ local vinyl = import 'panels/vinyl.libsonnet';
job=job,
),

cluster.read_only_status(
datasource=datasource,
job=job,
),

cluster.replication_lag(
datasource=datasource,
job=job,
Expand Down
Loading

0 comments on commit 2b258ea

Please sign in to comment.