Skip to content

Commit

Permalink
dashboard: use new metrics instead of deprecated ones
Browse files Browse the repository at this point in the history
In metrics 0.13.0, the following metrics were deprecated:
- tnt_replication_*_lag
- tnt_fiber_count
- tnt_space_count
- tnt_vinyl_scheduler_dump_count

Instead of them, new metrics were introduced:
- tnt_replication_lag
- tnt_fiber_amount
- tnt_vinyl_tuples
- tnt_vinyl_scheduler_dump_total

This patch replaces deprecated metrics with their aliases.

Closes #133
  • Loading branch information
DifferentialOrange committed May 5, 2022
1 parent 27d39c4 commit 0afc64c
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 47 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Update metrics version to 0.13.0
- Update panel descriptions
- Collapse dashboard rows
- Use new metrics instead of deprecated ones


## [0.3.3] - 2021-10-08
Grafana revisions: [InfluxDB revision 8](https://grafana.com/api/dashboards/12567/revisions/8/download), [Prometheus revision 8](https://grafana.com/api/dashboards/13054/revisions/8/download)
Expand Down
12 changes: 7 additions & 5 deletions dashboard/panels/cluster.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ local prometheus = grafana.prometheus;
title='Tarantool replication lag',
description=|||
Replication lag value for Tarantool instance.
Panel works with `metrics >= 0.13.0`.
|||,
datasource=null,
policy=null,
Expand All @@ -476,16 +478,16 @@ local prometheus = grafana.prometheus;
).addTarget(
if datasource == '${DS_PROMETHEUS}' then
prometheus.target(
expr=std.format('{__name__=~"tnt_replication_[[:digit:]]{1,2}_lag", job=~"%s"}', [job]),
legendFormat='{{alias}}',
expr=std.format('tnt_replication_lag{job=~"%s"}', [job]),
legendFormat='{{alias}} ({{id}})',
)
else if datasource == '${DS_INFLUXDB}' then
influxdb.target(
policy=policy,
measurement=measurement,
group_tags=['label_pairs_alias'],
alias='$tag_label_pairs_alias',
).where('metric_name', '=~', '/tnt_replication_\\d{1,2}_lag/')
group_tags=['label_pairs_alias', 'label_pairs_id'],
alias='$tag_label_pairs_alias ($tag_label_pairs_id)',
).where('metric_name', '=', 'tnt_replication_lag')
.selectField('value').addConverter('mean')
),

Expand Down
4 changes: 3 additions & 1 deletion dashboard/panels/runtime.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ local common = import 'common.libsonnet';
title='Number of fibers',
description=|||
Current number of fibers in tx thread.
Panel works with `metrics >= 0.13.0`.
|||,
datasource=null,
policy=null,
Expand All @@ -73,7 +75,7 @@ local common = import 'common.libsonnet';
panel_width=8,
).addTarget(common.default_metric_target(
datasource,
'tnt_fiber_count',
'tnt_fiber_amount',
job,
policy,
measurement,
Expand Down
4 changes: 3 additions & 1 deletion dashboard/panels/space.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ local prometheus = grafana.prometheus;
include_vinyl_count to true. Beware that
count() operation scans the space and may
slow down your app.
Panel works with `metrics >= 0.13.0`.
|||,
datasource=null,
policy=null,
Expand All @@ -84,7 +86,7 @@ local prometheus = grafana.prometheus;
policy=policy,
measurement=measurement,
job=job,
metric_name='tnt_space_count',
metric_name='tnt_vinyl_tuples',
engine='vinyl'
),

Expand Down
5 changes: 3 additions & 2 deletions dashboard/panels/vinyl.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,8 @@ local prometheus = grafana.prometheus;
title='Vinyl scheduler dump count rate',
description=|||
Scheduler dumps completed average per second rate.
Panel works with `metrics >= 0.8.0`.
Panel works with `metrics >= 0.13.0`.
|||,
datasource=null,
policy=null,
Expand All @@ -642,7 +643,7 @@ local prometheus = grafana.prometheus;
panel_width=6,
).addTarget(common.default_rps_target(
datasource,
'tnt_vinyl_scheduler_dump_count',
'tnt_vinyl_scheduler_dump_total',
job,
rate_time_range,
policy,
Expand Down
26 changes: 16 additions & 10 deletions tests/InfluxDB/dashboard_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_INFLUXDB}",
"description": "Replication lag value for Tarantool instance.\n",
"description": "Replication lag value for Tarantool instance.\n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -700,7 +700,7 @@
"steppedLine": false,
"targets": [
{
"alias": "$tag_label_pairs_alias",
"alias": "$tag_label_pairs_alias ($tag_label_pairs_id)",
"groupBy": [
{
"params": [
Expand All @@ -714,6 +714,12 @@
],
"type": "tag"
},
{
"params": [
"label_pairs_id"
],
"type": "tag"
},
{
"params": [
"none"
Expand Down Expand Up @@ -742,8 +748,8 @@
"tags": [
{
"key": "metric_name",
"operator": "=~",
"value": "/tnt_replication_\\d{1,2}_lag/"
"operator": "=",
"value": "tnt_replication_lag"
}
]
}
Expand Down Expand Up @@ -4784,7 +4790,7 @@
"dashes": false,
"datasource": "${DS_INFLUXDB}",
"decimals": 0,
"description": "Number of records in the space (vinyl engine).\nName of space is specified after dash.\nBy default this metrics is disabled,\nto enable it you must set global variable\ninclude_vinyl_count to true. Beware that\ncount() operation scans the space and may\nslow down your app. \n",
"description": "Number of records in the space (vinyl engine).\nName of space is specified after dash.\nBy default this metrics is disabled,\nto enable it you must set global variable\ninclude_vinyl_count to true. Beware that\ncount() operation scans the space and may\nslow down your app. \n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -4871,7 +4877,7 @@
{
"key": "metric_name",
"operator": "=",
"value": "tnt_space_count"
"value": "tnt_vinyl_tuples"
},
{
"condition": "AND",
Expand Down Expand Up @@ -7514,7 +7520,7 @@
"dashes": false,
"datasource": "${DS_INFLUXDB}",
"decimals": 3,
"description": "Scheduler dumps completed average per second rate.\nPanel works with `metrics >= 0.8.0`.\n",
"description": "Scheduler dumps completed average per second rate.\n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -7601,7 +7607,7 @@
{
"key": "metric_name",
"operator": "=",
"value": "tnt_vinyl_scheduler_dump_count"
"value": "tnt_vinyl_scheduler_dump_total"
}
]
}
Expand Down Expand Up @@ -8495,7 +8501,7 @@
"dashes": false,
"datasource": "${DS_INFLUXDB}",
"decimals": 0,
"description": "Current number of fibers in tx thread. \n",
"description": "Current number of fibers in tx thread. \n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -8576,7 +8582,7 @@
{
"key": "metric_name",
"operator": "=",
"value": "tnt_fiber_count"
"value": "tnt_fiber_amount"
}
]
}
Expand Down
26 changes: 16 additions & 10 deletions tests/InfluxDB/dashboard_with_custom_panels_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_INFLUXDB}",
"description": "Replication lag value for Tarantool instance.\n",
"description": "Replication lag value for Tarantool instance.\n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -700,7 +700,7 @@
"steppedLine": false,
"targets": [
{
"alias": "$tag_label_pairs_alias",
"alias": "$tag_label_pairs_alias ($tag_label_pairs_id)",
"groupBy": [
{
"params": [
Expand All @@ -714,6 +714,12 @@
],
"type": "tag"
},
{
"params": [
"label_pairs_id"
],
"type": "tag"
},
{
"params": [
"none"
Expand Down Expand Up @@ -742,8 +748,8 @@
"tags": [
{
"key": "metric_name",
"operator": "=~",
"value": "/tnt_replication_\\d{1,2}_lag/"
"operator": "=",
"value": "tnt_replication_lag"
}
]
}
Expand Down Expand Up @@ -4784,7 +4790,7 @@
"dashes": false,
"datasource": "${DS_INFLUXDB}",
"decimals": 0,
"description": "Number of records in the space (vinyl engine).\nName of space is specified after dash.\nBy default this metrics is disabled,\nto enable it you must set global variable\ninclude_vinyl_count to true. Beware that\ncount() operation scans the space and may\nslow down your app. \n",
"description": "Number of records in the space (vinyl engine).\nName of space is specified after dash.\nBy default this metrics is disabled,\nto enable it you must set global variable\ninclude_vinyl_count to true. Beware that\ncount() operation scans the space and may\nslow down your app. \n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -4871,7 +4877,7 @@
{
"key": "metric_name",
"operator": "=",
"value": "tnt_space_count"
"value": "tnt_vinyl_tuples"
},
{
"condition": "AND",
Expand Down Expand Up @@ -7514,7 +7520,7 @@
"dashes": false,
"datasource": "${DS_INFLUXDB}",
"decimals": 3,
"description": "Scheduler dumps completed average per second rate.\nPanel works with `metrics >= 0.8.0`.\n",
"description": "Scheduler dumps completed average per second rate.\n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -7601,7 +7607,7 @@
{
"key": "metric_name",
"operator": "=",
"value": "tnt_vinyl_scheduler_dump_count"
"value": "tnt_vinyl_scheduler_dump_total"
}
]
}
Expand Down Expand Up @@ -8495,7 +8501,7 @@
"dashes": false,
"datasource": "${DS_INFLUXDB}",
"decimals": 0,
"description": "Current number of fibers in tx thread. \n",
"description": "Current number of fibers in tx thread. \n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -8576,7 +8582,7 @@
{
"key": "metric_name",
"operator": "=",
"value": "tnt_fiber_count"
"value": "tnt_fiber_amount"
}
]
}
Expand Down
18 changes: 9 additions & 9 deletions tests/Prometheus/dashboard_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -891,7 +891,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"description": "Replication lag value for Tarantool instance.\n",
"description": "Replication lag value for Tarantool instance.\n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -929,10 +929,10 @@
"steppedLine": false,
"targets": [
{
"expr": "{__name__=~\"tnt_replication_[[:digit:]]{1,2}_lag\", job=~\"$job\"}",
"expr": "tnt_replication_lag{job=~\"$job\"}",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{alias}}",
"legendFormat": "{{alias}} ({{id}})",
"refId": "A"
}
],
Expand Down Expand Up @@ -3590,7 +3590,7 @@
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"decimals": 0,
"description": "Number of records in the space (vinyl engine).\nName of space is specified after dash.\nBy default this metrics is disabled,\nto enable it you must set global variable\ninclude_vinyl_count to true. Beware that\ncount() operation scans the space and may\nslow down your app. \n",
"description": "Number of records in the space (vinyl engine).\nName of space is specified after dash.\nBy default this metrics is disabled,\nto enable it you must set global variable\ninclude_vinyl_count to true. Beware that\ncount() operation scans the space and may\nslow down your app. \n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -3628,7 +3628,7 @@
"steppedLine": false,
"targets": [
{
"expr": "tnt_space_count{job=~\"$job\", engine=\"vinyl\"}",
"expr": "tnt_vinyl_tuples{job=~\"$job\", engine=\"vinyl\"}",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{alias}} — {{name}}",
Expand Down Expand Up @@ -5410,7 +5410,7 @@
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"decimals": 3,
"description": "Scheduler dumps completed average per second rate.\nPanel works with `metrics >= 0.8.0`.\n\n\nIf `No data` displayed, check up your 'rate_time_range' variable.",
"description": "Scheduler dumps completed average per second rate.\n\nPanel works with `metrics >= 0.13.0`.\n\n\nIf `No data` displayed, check up your 'rate_time_range' variable.",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -5448,7 +5448,7 @@
"steppedLine": false,
"targets": [
{
"expr": "rate(tnt_vinyl_scheduler_dump_count{job=~\"$job\"}[$rate_time_range])",
"expr": "rate(tnt_vinyl_scheduler_dump_total{job=~\"$job\"}[$rate_time_range])",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{alias}}",
Expand Down Expand Up @@ -6080,7 +6080,7 @@
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"decimals": 0,
"description": "Current number of fibers in tx thread. \n",
"description": "Current number of fibers in tx thread. \n\nPanel works with `metrics >= 0.13.0`.\n",
"fill": 0,
"gridPos": {
"h": 8,
Expand Down Expand Up @@ -6118,7 +6118,7 @@
"steppedLine": false,
"targets": [
{
"expr": "tnt_fiber_count{job=~\"$job\"}",
"expr": "tnt_fiber_amount{job=~\"$job\"}",
"format": "time_series",
"intervalFactor": 2,
"legendFormat": "{{alias}}",
Expand Down
Loading

0 comments on commit 0afc64c

Please sign in to comment.