diff --git a/CHANGELOG.md b/CHANGELOG.md index a0cd395..a9c12aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed +- Use Grafana 11 color scheme for Prometheus cluster overview panel (#234) +- Drop Grafana 8 support (#234) +- Bump recommended requirements to Grafana 11 (#234) + +### Fixed +- Prometheus cluster overview panel not works for Grafana 11+ (#234) + + ## [3.1.0] - 2024-07-09 Grafana revisions: - Tarantool 3: diff --git a/dashboard/build/dashboard.libsonnet b/dashboard/build/dashboard.libsonnet index 785b84a..e636f68 100644 --- a/dashboard/build/dashboard.libsonnet +++ b/dashboard/build/dashboard.libsonnet @@ -170,7 +170,7 @@ function(cfg) std.foldl( type='grafana', id='grafana', name='Grafana', - version='8.0.0' + version='9.0.0' ).addRequired( type='panel', id='graph', diff --git a/dashboard/panels/cluster.libsonnet b/dashboard/panels/cluster.libsonnet index c282db8..abd6f2a 100644 --- a/dashboard/panels/cluster.libsonnet +++ b/dashboard/panels/cluster.libsonnet @@ -27,50 +27,23 @@ local prometheus = grafana.prometheus; Instance alias filtering is disabled here. If Prometheus job filter is not specified, displays running instances - and ignores unreachable instances (we have no specific source to fetch) + and ignores unreachable instances (we have no specific source to fetch). + + Color scheme is expected to work properly only for Grafana 11+. |||), ):: tablePanel.new( title=title, description=description, datasource=cfg.datasource, - styles=[ - { - alias: 'Instance alias', - pattern: 'alias', - thresholds: [], - type: 'string', - mappingType: 1, - }, - { - alias: 'Instance URI', - pattern: 'instance', - thresholds: [], - type: 'string', - mappingType: 1, - }, - { - alias: 'Uptime', - colorMode: 'row', - colors: [ - 'rgba(245, 54, 54, 0.9)', - 'rgba(237, 129, 40, 0.89)', - 'rgba(50, 172, 45, 0.97)', - ], - decimals: 0, - mappingType: 1, - pattern: 'Value', - thresholds: ['0.1', '0.1'], - type: 'number', - unit: 's', - }, - ], + styles=null, + sort={ col: 2, desc: false, }, transform='table', - ).hideColumn('job').hideColumn('/.*/').addTarget( + ).addTarget( if cfg.type == variable.datasource_type.prometheus then prometheus.target( expr=if std.objectHas(cfg.filters, 'job') then @@ -96,7 +69,163 @@ local prometheus = grafana.prometheus; ) else if cfg.type == variable.datasource_type.influxdb then error 'InfluxDB target is not supported yet' - ) { gridPos: { w: 12, h: 8 } }, + ) { + // Workaround is expected to be removed after migrating to + // https://github.com/tarantool/grafana-dashboard/issues/215 + fieldConfig: { + defaults: { + custom: { + cellOptions: { + type: 'auto', + }, + inspect: false, + }, + mappings: [], + thresholds: { + mode: 'absolute', + steps: [ + { + color: 'green', + value: null, + }, + { + color: 'red', + value: 80, + }, + ], + }, + }, + overrides: [ + { + matcher: { + id: 'byName', + options: 'alias', + }, + properties: [ + { + id: 'displayName', + value: 'Instance alias', + }, + { + id: 'custom.align', + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'instance', + }, + properties: [ + { + id: 'displayName', + value: 'Instance URI', + }, + { + id: 'custom.align', + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Value', + }, + properties: [ + { + id: 'displayName', + value: 'Uptime', + }, + { + id: 'unit', + value: 's', + }, + { + id: 'custom.cellOptions', + value: { + applyToRow: true, + type: 'color-background', + }, + }, + { + id: 'custom.align', + }, + { + id: 'thresholds', + value: { + mode: 'absolute', + steps: [ + { + color: 'rgba(245, 54, 54, 0.9)', + value: null, + }, + { + color: 'rgba(50, 172, 45, 0.97)', + value: 0.1, + }, + ], + }, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'job', + }, + properties: [ + { + id: 'displayName', + value: 'job', + }, + { + id: 'custom.hidden', + value: true, + }, + { + id: 'custom.align', + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'job', + }, + properties: [ + { + id: 'custom.hidden', + value: true, + }, + ], + }, + { + matcher: { + id: 'byName', + options: 'Time', + }, + properties: [ + { + id: 'custom.hidden', + value: true, + }, + ], + }, + { + matcher: { + id: 'byName', + options: '__name__', + }, + properties: [ + { + id: 'custom.hidden', + value: true, + }, + ], + }, + ], + }, + } { gridPos: { w: 12, h: 8 } }, local title_workaround( // Workaround for missing options.fieldOptions.defaults.title https://github.com/grafana/grafonnet-lib/pull/260 stat_panel, diff --git a/docker-compose.cartridge.yml b/docker-compose.cartridge.yml index 7cb3d57..1d883bc 100644 --- a/docker-compose.cartridge.yml +++ b/docker-compose.cartridge.yml @@ -48,7 +48,7 @@ services: - 8086:8086 prometheus: - image: prom/prometheus:v2.17.2 + image: prom/prometheus:v2.53.1 networks: tarantool_dashboard_dev: ports: @@ -58,7 +58,7 @@ services: - ./example_cluster/prometheus/alerts.yml:/etc/prometheus/cartridge_alerts.yml grafana: - image: grafana/grafana:8.1.3 + image: grafana/grafana:11.2.2 environment: GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true" GF_AUTH_ANONYMOUS_ENABLED: "true" diff --git a/docker-compose.localapp.yml b/docker-compose.localapp.yml index f903de2..ed7c37a 100644 --- a/docker-compose.localapp.yml +++ b/docker-compose.localapp.yml @@ -25,7 +25,7 @@ services: - 8086:8086 prometheus: - image: prom/prometheus:v2.17.2 + image: prom/prometheus:v2.53.1 networks: tarantool_dashboard_dev: extra_hosts: @@ -37,7 +37,7 @@ services: - ./example_cluster/prometheus/alerts.yml:/etc/prometheus/alerts.yml grafana: - image: grafana/grafana:8.1.5 + image: grafana/grafana:11.2.2 environment: GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true" GF_AUTH_ANONYMOUS_ENABLED: "true" diff --git a/docker-compose.tdg.yml b/docker-compose.tdg.yml index 197e50d..c53ee90 100644 --- a/docker-compose.tdg.yml +++ b/docker-compose.tdg.yml @@ -56,7 +56,7 @@ services: - 8086:8086 prometheus: - image: prom/prometheus:v2.17.2 + image: prom/prometheus:v2.53.1 networks: tarantool_dashboard_dev: ports: @@ -65,7 +65,7 @@ services: - ./example_cluster/prometheus/prometheus.tdg.yml:/etc/prometheus/prometheus.yml grafana: - image: grafana/grafana:8.1.5 + image: grafana/grafana:11.2.2 environment: GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true" GF_AUTH_ANONYMOUS_ENABLED: "true" diff --git a/docker-compose.yml b/docker-compose.yml index 629db73..2ff4c35 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -48,7 +48,7 @@ services: - 8086:8086 prometheus: - image: prom/prometheus:v2.17.2 + image: prom/prometheus:v2.53.1 networks: tarantool_dashboard_dev: ports: @@ -58,7 +58,7 @@ services: - ./example_cluster/prometheus/alerts.yml:/etc/prometheus/alerts.yml grafana: - image: grafana/grafana:8.1.3 + image: grafana/grafana:11.2.2 environment: GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION: "true" GF_AUTH_ANONYMOUS_ENABLED: "true" diff --git a/example_cluster/tarantool3_project/app.Dockerfile b/example_cluster/tarantool3_project/app.Dockerfile index 89b5a4e..1d79781 100644 --- a/example_cluster/tarantool3_project/app.Dockerfile +++ b/example_cluster/tarantool3_project/app.Dockerfile @@ -17,7 +17,7 @@ RUN curl -L https://tarantool.io/release/3/installer.sh | bash RUN DEBIAN_FRONTEND=noninteractive apt install -y tarantool tarantool-dev tt RUN tt init -# Need tt log +# Need tt start -i RUN DEBIAN_FRONTEND=noninteractive apt install -y git patch RUN git clone https://github.com/magefile/mage && \ cd mage && \ @@ -25,4 +25,4 @@ RUN git clone https://github.com/magefile/mage && \ RUN tt install tt master RUN tt rocks make -ENTRYPOINT tt start && tt log -f +ENTRYPOINT tt start -i diff --git a/tests/InfluxDB/dashboard_cartridge_compiled.json b/tests/InfluxDB/dashboard_cartridge_compiled.json index 61cbb10..9c43153 100644 --- a/tests/InfluxDB/dashboard_cartridge_compiled.json +++ b/tests/InfluxDB/dashboard_cartridge_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", diff --git a/tests/InfluxDB/dashboard_custom_compiled.json b/tests/InfluxDB/dashboard_custom_compiled.json index 686a6d4..dfbcf6f 100644 --- a/tests/InfluxDB/dashboard_custom_compiled.json +++ b/tests/InfluxDB/dashboard_custom_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", diff --git a/tests/InfluxDB/dashboard_tarantool3_compiled.json b/tests/InfluxDB/dashboard_tarantool3_compiled.json index d1ca12d..3598c05 100644 --- a/tests/InfluxDB/dashboard_tarantool3_compiled.json +++ b/tests/InfluxDB/dashboard_tarantool3_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", diff --git a/tests/InfluxDB/dashboard_tdg_compiled.json b/tests/InfluxDB/dashboard_tdg_compiled.json index 4e49183..b502956 100644 --- a/tests/InfluxDB/dashboard_tdg_compiled.json +++ b/tests/InfluxDB/dashboard_tdg_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", diff --git a/tests/InfluxDB/dashboard_with_custom_panels_compiled.json b/tests/InfluxDB/dashboard_with_custom_panels_compiled.json index c57b69b..39c0be0 100644 --- a/tests/InfluxDB/dashboard_with_custom_panels_compiled.json +++ b/tests/InfluxDB/dashboard_with_custom_panels_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", diff --git a/tests/Prometheus/dashboard_cartridge_compiled.json b/tests/Prometheus/dashboard_cartridge_compiled.json index 3ee7713..9ecabd8 100644 --- a/tests/Prometheus/dashboard_cartridge_compiled.json +++ b/tests/Prometheus/dashboard_cartridge_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", @@ -69,7 +69,160 @@ { "columns": [ ], "datasource": "$prometheus", - "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch)\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch).\n\nColor scheme is expected to work properly only for Grafana 11+.\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "fieldConfig": { + "defaults": { + "custom": { + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "alias" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance alias" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "instance" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance URI" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "displayName", + "value": "Uptime" + }, + { + "id": "unit", + "value": "s" + }, + { + "id": "custom.cellOptions", + "value": { + "applyToRow": true, + "type": "color-background" + } + }, + { + "id": "custom.align" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(245, 54, 54, 0.9)", + "value": null + }, + { + "color": "rgba(50, 172, 45, 0.97)", + "value": 0.10000000000000001 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "displayName", + "value": "job" + }, + { + "id": "custom.hidden", + "value": true + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "__name__" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + } + ] + }, "gridPos": { "h": 8, "w": 12, @@ -82,50 +235,7 @@ "col": 2, "desc": false }, - "styles": [ - { - "alias": "Instance alias", - "mappingType": 1, - "pattern": "alias", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Instance URI", - "mappingType": 1, - "pattern": "instance", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Uptime", - "colorMode": "row", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [ - "0.1", - "0.1" - ], - "type": "number", - "unit": "s" - }, - { - "alias": "job", - "pattern": "job", - "type": "hidden" - }, - { - "alias": "/.*/", - "pattern": "/.*/", - "type": "hidden" - } - ], + "styles": null, "targets": [ { "expr": "up{job=~\"$job\"} * on(instance) group_left(alias) tnt_info_uptime{job=~\"$job\"} or\non(instance) label_replace(up{job=~\"$job\"}, \"alias\", \"Not available\", \"instance\", \".*\")\n", diff --git a/tests/Prometheus/dashboard_custom_compiled.json b/tests/Prometheus/dashboard_custom_compiled.json index 50270d0..efcd4d3 100644 --- a/tests/Prometheus/dashboard_custom_compiled.json +++ b/tests/Prometheus/dashboard_custom_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", @@ -69,7 +69,160 @@ { "columns": [ ], "datasource": "$prometheus", - "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch)\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch).\n\nColor scheme is expected to work properly only for Grafana 11+.\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "fieldConfig": { + "defaults": { + "custom": { + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "alias" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance alias" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "instance" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance URI" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "displayName", + "value": "Uptime" + }, + { + "id": "unit", + "value": "s" + }, + { + "id": "custom.cellOptions", + "value": { + "applyToRow": true, + "type": "color-background" + } + }, + { + "id": "custom.align" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(245, 54, 54, 0.9)", + "value": null + }, + { + "color": "rgba(50, 172, 45, 0.97)", + "value": 0.10000000000000001 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "displayName", + "value": "job" + }, + { + "id": "custom.hidden", + "value": true + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "__name__" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + } + ] + }, "gridPos": { "h": 8, "w": 12, @@ -82,50 +235,7 @@ "col": 2, "desc": false }, - "styles": [ - { - "alias": "Instance alias", - "mappingType": 1, - "pattern": "alias", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Instance URI", - "mappingType": 1, - "pattern": "instance", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Uptime", - "colorMode": "row", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [ - "0.1", - "0.1" - ], - "type": "number", - "unit": "s" - }, - { - "alias": "job", - "pattern": "job", - "type": "hidden" - }, - { - "alias": "/.*/", - "pattern": "/.*/", - "type": "hidden" - } - ], + "styles": null, "targets": [ { "expr": "vendor_tt_tnt_info_uptime{vendor_app_label=\"MyCacheApplication\"}", diff --git a/tests/Prometheus/dashboard_tarantool3_compiled.json b/tests/Prometheus/dashboard_tarantool3_compiled.json index c533903..fa7c8c4 100644 --- a/tests/Prometheus/dashboard_tarantool3_compiled.json +++ b/tests/Prometheus/dashboard_tarantool3_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", @@ -69,7 +69,160 @@ { "columns": [ ], "datasource": "$prometheus", - "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch)\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch).\n\nColor scheme is expected to work properly only for Grafana 11+.\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "fieldConfig": { + "defaults": { + "custom": { + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "alias" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance alias" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "instance" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance URI" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "displayName", + "value": "Uptime" + }, + { + "id": "unit", + "value": "s" + }, + { + "id": "custom.cellOptions", + "value": { + "applyToRow": true, + "type": "color-background" + } + }, + { + "id": "custom.align" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(245, 54, 54, 0.9)", + "value": null + }, + { + "color": "rgba(50, 172, 45, 0.97)", + "value": 0.10000000000000001 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "displayName", + "value": "job" + }, + { + "id": "custom.hidden", + "value": true + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "__name__" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + } + ] + }, "gridPos": { "h": 8, "w": 12, @@ -82,50 +235,7 @@ "col": 2, "desc": false }, - "styles": [ - { - "alias": "Instance alias", - "mappingType": 1, - "pattern": "alias", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Instance URI", - "mappingType": 1, - "pattern": "instance", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Uptime", - "colorMode": "row", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [ - "0.1", - "0.1" - ], - "type": "number", - "unit": "s" - }, - { - "alias": "job", - "pattern": "job", - "type": "hidden" - }, - { - "alias": "/.*/", - "pattern": "/.*/", - "type": "hidden" - } - ], + "styles": null, "targets": [ { "expr": "up{job=~\"$job\"} * on(instance) group_left(alias) tnt_info_uptime{job=~\"$job\"} or\non(instance) label_replace(up{job=~\"$job\"}, \"alias\", \"Not available\", \"instance\", \".*\")\n", diff --git a/tests/Prometheus/dashboard_tdg_compiled.json b/tests/Prometheus/dashboard_tdg_compiled.json index fdf195e..5d179cd 100644 --- a/tests/Prometheus/dashboard_tdg_compiled.json +++ b/tests/Prometheus/dashboard_tdg_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", @@ -69,7 +69,160 @@ { "columns": [ ], "datasource": "$prometheus", - "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch)\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch).\n\nColor scheme is expected to work properly only for Grafana 11+.\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "fieldConfig": { + "defaults": { + "custom": { + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "alias" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance alias" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "instance" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance URI" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "displayName", + "value": "Uptime" + }, + { + "id": "unit", + "value": "s" + }, + { + "id": "custom.cellOptions", + "value": { + "applyToRow": true, + "type": "color-background" + } + }, + { + "id": "custom.align" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(245, 54, 54, 0.9)", + "value": null + }, + { + "color": "rgba(50, 172, 45, 0.97)", + "value": 0.10000000000000001 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "displayName", + "value": "job" + }, + { + "id": "custom.hidden", + "value": true + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "__name__" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + } + ] + }, "gridPos": { "h": 8, "w": 12, @@ -82,50 +235,7 @@ "col": 2, "desc": false }, - "styles": [ - { - "alias": "Instance alias", - "mappingType": 1, - "pattern": "alias", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Instance URI", - "mappingType": 1, - "pattern": "instance", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Uptime", - "colorMode": "row", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [ - "0.1", - "0.1" - ], - "type": "number", - "unit": "s" - }, - { - "alias": "job", - "pattern": "job", - "type": "hidden" - }, - { - "alias": "/.*/", - "pattern": "/.*/", - "type": "hidden" - } - ], + "styles": null, "targets": [ { "expr": "up{job=~\"$job\"} * on(instance) group_left(alias) tnt_info_uptime{job=~\"$job\"} or\non(instance) label_replace(up{job=~\"$job\"}, \"alias\", \"Not available\", \"instance\", \".*\")\n", diff --git a/tests/Prometheus/dashboard_with_custom_panels_compiled.json b/tests/Prometheus/dashboard_with_custom_panels_compiled.json index f80fc80..ce5c042 100644 --- a/tests/Prometheus/dashboard_with_custom_panels_compiled.json +++ b/tests/Prometheus/dashboard_with_custom_panels_compiled.json @@ -5,7 +5,7 @@ "id": "grafana", "name": "Grafana", "type": "grafana", - "version": "8.0.0" + "version": "9.0.0" }, { "id": "graph", @@ -69,7 +69,160 @@ { "columns": [ ], "datasource": "$prometheus", - "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch)\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "description": "Overview of Tarantool instances observed by Prometheus job.\n\nIf instance row is *red*, it means Prometheus can't reach\nURI specified in targets or ran into error.\nIf instance row is *green*, it means instance is up and running and\nPrometheus is successfully extracting metrics from it.\n\"Uptime\" column shows time since instant start.\n\nInstance alias filtering is disabled here.\n\nIf Prometheus job filter is not specified, displays running instances\nand ignores unreachable instances (we have no specific source to fetch).\n\nColor scheme is expected to work properly only for Grafana 11+.\n\nThis panel is designed to work with Prometheus client\nset up to have each Tarantool instance as a separate pull target.\n", + "fieldConfig": { + "defaults": { + "custom": { + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [ ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "alias" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance alias" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "instance" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance URI" + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "displayName", + "value": "Uptime" + }, + { + "id": "unit", + "value": "s" + }, + { + "id": "custom.cellOptions", + "value": { + "applyToRow": true, + "type": "color-background" + } + }, + { + "id": "custom.align" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(245, 54, 54, 0.9)", + "value": null + }, + { + "color": "rgba(50, 172, 45, 0.97)", + "value": 0.10000000000000001 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "displayName", + "value": "job" + }, + { + "id": "custom.hidden", + "value": true + }, + { + "id": "custom.align" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "__name__" + }, + "properties": [ + { + "id": "custom.hidden", + "value": true + } + ] + } + ] + }, "gridPos": { "h": 8, "w": 12, @@ -82,50 +235,7 @@ "col": 2, "desc": false }, - "styles": [ - { - "alias": "Instance alias", - "mappingType": 1, - "pattern": "alias", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Instance URI", - "mappingType": 1, - "pattern": "instance", - "thresholds": [ ], - "type": "string" - }, - { - "alias": "Uptime", - "colorMode": "row", - "colors": [ - "rgba(245, 54, 54, 0.9)", - "rgba(237, 129, 40, 0.89)", - "rgba(50, 172, 45, 0.97)" - ], - "decimals": 0, - "mappingType": 1, - "pattern": "Value", - "thresholds": [ - "0.1", - "0.1" - ], - "type": "number", - "unit": "s" - }, - { - "alias": "job", - "pattern": "job", - "type": "hidden" - }, - { - "alias": "/.*/", - "pattern": "/.*/", - "type": "hidden" - } - ], + "styles": null, "targets": [ { "expr": "up{job=~\"$job\"} * on(instance) group_left(alias) tnt_info_uptime{job=~\"$job\"} or\non(instance) label_replace(up{job=~\"$job\"}, \"alias\", \"Not available\", \"instance\", \".*\")\n",