Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard: fix cluster overview for Grafana 11 #235

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion dashboard/build/dashboard.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
197 changes: 163 additions & 34 deletions dashboard/panels/cluster.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.cartridge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.localapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.tdg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions example_cluster/tarantool3_project/app.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ 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 && \
go run bootstrap.go
RUN tt install tt master

RUN tt rocks make
ENTRYPOINT tt start && tt log -f
ENTRYPOINT tt start -i
2 changes: 1 addition & 1 deletion tests/InfluxDB/dashboard_cartridge_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "grafana",
"name": "Grafana",
"type": "grafana",
"version": "8.0.0"
"version": "9.0.0"
},
{
"id": "graph",
Expand Down
2 changes: 1 addition & 1 deletion tests/InfluxDB/dashboard_custom_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "grafana",
"name": "Grafana",
"type": "grafana",
"version": "8.0.0"
"version": "9.0.0"
},
{
"id": "graph",
Expand Down
2 changes: 1 addition & 1 deletion tests/InfluxDB/dashboard_tarantool3_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "grafana",
"name": "Grafana",
"type": "grafana",
"version": "8.0.0"
"version": "9.0.0"
},
{
"id": "graph",
Expand Down
2 changes: 1 addition & 1 deletion tests/InfluxDB/dashboard_tdg_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "grafana",
"name": "Grafana",
"type": "grafana",
"version": "8.0.0"
"version": "9.0.0"
},
{
"id": "graph",
Expand Down
2 changes: 1 addition & 1 deletion tests/InfluxDB/dashboard_with_custom_panels_compiled.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "grafana",
"name": "Grafana",
"type": "grafana",
"version": "8.0.0"
"version": "9.0.0"
},
{
"id": "graph",
Expand Down
Loading
Loading