From f49e1f3ff545569aa3bbabe2da3d1e8016792008 Mon Sep 17 00:00:00 2001 From: Yufei Li Date: Thu, 8 Jun 2023 16:49:47 +0800 Subject: [PATCH] feat: Add grafana importer (#12) --- .github/PULL_REQUEST_TEMPLATE/proposal.md | 4 +- .github/workflows/pre-commit.yml | 16 +- .gitignore | 8 +- .markdownlint.yml | 1 + .prettierignore | 2 + README.md | 22 +- docs/references/guance.md | 2 +- docs/references/guance_iac.md | 2 +- docs/references/guance_iac_import.md | 14 +- docs/references/guance_iac_import_console.md | 23 + docs/references/guance_iac_import_grafana.md | 22 + .../man/guance-iac-import-console.1 | 48 + .../man/guance-iac-import-grafana.1 | 44 + docs/references/man/guance-iac-import.1 | 22 +- docs/references/man/guance-iac.1 | 4 +- docs/references/man/guance.1 | 4 +- go.mod | 24 +- go.sum | 103 +- internal/cmd/iac/cmd.go | 211 +- internal/cmd/iac/import/console/cmd.go | 85 + internal/cmd/iac/import/grafana/builder.go | 135 + .../cmd/iac/import/grafana/chart/chart.go | 10 + internal/cmd/iac/import/grafana/charts/all.go | 47 + .../grafana/charts/bargauge/bargauge.go | 67 + .../grafana/charts/bargauge/bargauge_test.go | 56 + .../bargauge/testdata/gauge.grafana.json | 51 + .../bargauge/testdata/gauge.guance.json | 49 + .../cmd/iac/import/grafana/charts/dummy.go | 15 + .../iac/import/grafana/charts/gauge/gauge.go | 85 + .../import/grafana/charts/gauge/gauge_test.go | 56 + .../charts/gauge/testdata/gauge.grafana.json | 54 + .../charts/gauge/testdata/gauge.guance.json | 53 + .../iac/import/grafana/charts/stat/stat.go | 68 + .../import/grafana/charts/stat/stat_test.go | 56 + .../charts/stat/testdata/stat.grafana.json | 80 + .../charts/stat/testdata/stat.guance.json | 48 + .../iac/import/grafana/charts/table/table.go | 62 + .../import/grafana/charts/table/table_test.go | 56 + .../charts/table/testdata/table.grafana.json | 223 + .../charts/table/testdata/table.guance.json | 44 + .../testdata/timeseries.grafana.json | 280 + .../testdata/timeseries.guance.json | 108 + .../grafana/charts/timeseries/timeseries.go | 56 + .../charts/timeseries/timeseries_test.go | 56 + internal/cmd/iac/import/grafana/cmd.go | 64 + internal/cmd/iac/import/grafana/cmd_test.go | 20 + .../grafana/datasources/prometheus/builder.go | 7 + .../grafana/datasources/prometheus/promql.go | 68 + .../datasources/prometheus/promql_test.go | 85 + .../grafana/datasources/prometheus/target.go | 55 + .../datasources/prometheus/variable.go | 73 + internal/cmd/iac/import/grafana/parser.go | 17 + .../cmd/iac/import/grafana/parser_test.go | 34 + .../cmd/iac/import/grafana/spec/README.md | 5 + internal/cmd/iac/import/grafana/spec/hack.go | 16 + internal/cmd/iac/import/grafana/spec/spec.cue | 611 + internal/cmd/iac/import/grafana/spec/spec.go | 814 + .../iac/import/grafana/testdata/example.json | 120 + .../tfmod/resources/dashboard/resource.go | 49 + .../resources/dashboard/template}/main.tf | 0 .../resources/dashboard/template}/outputs.tf | 0 .../dashboard/template}/variables.tf | 0 .../resources/dashboard/template}/versions.tf | 0 .../tfmod/resources/monitor/resource.go | 122 + .../resources/monitor/template}/main.tf.gotpl | 6 +- .../monitor/template}/outputs.tf.gotpl | 4 +- .../resources/monitor/template}/variables.tf | 0 .../resources/monitor/template}/versions.tf | 0 internal/helpers/osfs/file.go | 42 + internal/helpers/osfs/file_test.go | 41 + internal/helpers/osfs/render.go | 19 + internal/helpers/osfs/render_test.go | 20 + internal/helpers/prettier/json.go | 19 + internal/helpers/prettier/json_test.go | 41 + internal/helpers/prettier/space.go | 16 + internal/helpers/prettier/space_test.go | 47 + internal/helpers/types/codec.go | 22 + internal/helpers/types/float.go | 29 + internal/helpers/types/string.go | 15 + internal/magefiles/run.go | 55 +- internal/magefiles/test.go | 88 + internal/testing/specs/iac/import.spec | 6 - internal/testing/stepimpl/stepimpl.go | 5 + proposals/A001-guance-cli-overview.md | 28 +- .../C001-continuous-integration-jmeter.md | 104 +- proposals/C002-importer-grafana.md | 28 +- specs/guance.spec.md | 12 +- specs/iac/import/console.spec.md | 11 - specs/iac/import/console/console.spec.md | 11 + .../import/{ => console}/dashboard/input.json | 0 .../{ => console}/dashboard/snapshot/main.tf | 0 .../dashboard/snapshot/manifest.json | 0 .../dashboard/snapshot/outputs.tf | 0 .../dashboard/snapshot/variables.tf | 0 .../dashboard}/snapshot/versions.tf | 0 .../import/{ => console}/monitor/input.json | 0 .../{ => console}/monitor/snapshot/main.tf | 0 .../monitor/snapshot/manifest-001.json | 0 .../monitor/snapshot/manifest-002.json | 0 .../{ => console}/monitor/snapshot/outputs.tf | 0 .../monitor/snapshot/variables.tf | 0 .../console/monitor/snapshot/versions.tf | 9 + specs/iac/import/grafana.spec.md | 1 - specs/iac/import/grafana/config/datakit.conf | 78 + .../import/grafana/config/docker-compose.yml | 23 + specs/iac/import/grafana/config/preview.png | 3 + specs/iac/import/grafana/config/prom.conf | 8 + specs/iac/import/grafana/grafana.spec.md | 32 + specs/iac/import/grafana/input.json | 23367 ++++++++++++++++ specs/iac/import/grafana/snapshot/main.tf | 4 + .../iac/import/grafana/snapshot/manifest.json | 6374 +++++ specs/iac/import/grafana/snapshot/outputs.tf | 4 + .../iac/import/grafana/snapshot/variables.tf | 4 + specs/iac/import/grafana/snapshot/versions.tf | 9 + 114 files changed, 34800 insertions(+), 421 deletions(-) create mode 100644 docs/references/guance_iac_import_console.md create mode 100644 docs/references/guance_iac_import_grafana.md create mode 100644 docs/references/man/guance-iac-import-console.1 create mode 100644 docs/references/man/guance-iac-import-grafana.1 create mode 100644 internal/cmd/iac/import/console/cmd.go create mode 100644 internal/cmd/iac/import/grafana/builder.go create mode 100644 internal/cmd/iac/import/grafana/chart/chart.go create mode 100644 internal/cmd/iac/import/grafana/charts/all.go create mode 100644 internal/cmd/iac/import/grafana/charts/bargauge/bargauge.go create mode 100644 internal/cmd/iac/import/grafana/charts/bargauge/bargauge_test.go create mode 100644 internal/cmd/iac/import/grafana/charts/bargauge/testdata/gauge.grafana.json create mode 100644 internal/cmd/iac/import/grafana/charts/bargauge/testdata/gauge.guance.json create mode 100644 internal/cmd/iac/import/grafana/charts/dummy.go create mode 100644 internal/cmd/iac/import/grafana/charts/gauge/gauge.go create mode 100644 internal/cmd/iac/import/grafana/charts/gauge/gauge_test.go create mode 100644 internal/cmd/iac/import/grafana/charts/gauge/testdata/gauge.grafana.json create mode 100644 internal/cmd/iac/import/grafana/charts/gauge/testdata/gauge.guance.json create mode 100644 internal/cmd/iac/import/grafana/charts/stat/stat.go create mode 100644 internal/cmd/iac/import/grafana/charts/stat/stat_test.go create mode 100644 internal/cmd/iac/import/grafana/charts/stat/testdata/stat.grafana.json create mode 100644 internal/cmd/iac/import/grafana/charts/stat/testdata/stat.guance.json create mode 100644 internal/cmd/iac/import/grafana/charts/table/table.go create mode 100644 internal/cmd/iac/import/grafana/charts/table/table_test.go create mode 100644 internal/cmd/iac/import/grafana/charts/table/testdata/table.grafana.json create mode 100644 internal/cmd/iac/import/grafana/charts/table/testdata/table.guance.json create mode 100644 internal/cmd/iac/import/grafana/charts/timeseries/testdata/timeseries.grafana.json create mode 100644 internal/cmd/iac/import/grafana/charts/timeseries/testdata/timeseries.guance.json create mode 100644 internal/cmd/iac/import/grafana/charts/timeseries/timeseries.go create mode 100644 internal/cmd/iac/import/grafana/charts/timeseries/timeseries_test.go create mode 100644 internal/cmd/iac/import/grafana/cmd.go create mode 100644 internal/cmd/iac/import/grafana/cmd_test.go create mode 100644 internal/cmd/iac/import/grafana/datasources/prometheus/builder.go create mode 100644 internal/cmd/iac/import/grafana/datasources/prometheus/promql.go create mode 100644 internal/cmd/iac/import/grafana/datasources/prometheus/promql_test.go create mode 100644 internal/cmd/iac/import/grafana/datasources/prometheus/target.go create mode 100644 internal/cmd/iac/import/grafana/datasources/prometheus/variable.go create mode 100644 internal/cmd/iac/import/grafana/parser.go create mode 100644 internal/cmd/iac/import/grafana/parser_test.go create mode 100644 internal/cmd/iac/import/grafana/spec/README.md create mode 100644 internal/cmd/iac/import/grafana/spec/hack.go create mode 100644 internal/cmd/iac/import/grafana/spec/spec.cue create mode 100644 internal/cmd/iac/import/grafana/spec/spec.go create mode 100644 internal/cmd/iac/import/grafana/testdata/example.json create mode 100644 internal/generator/tfmod/resources/dashboard/resource.go rename internal/{cmd/iac/template/terraform-module/dashboard => generator/tfmod/resources/dashboard/template}/main.tf (100%) rename internal/{cmd/iac/template/terraform-module/dashboard => generator/tfmod/resources/dashboard/template}/outputs.tf (100%) rename internal/{cmd/iac/template/terraform-module/dashboard => generator/tfmod/resources/dashboard/template}/variables.tf (100%) rename internal/{cmd/iac/template/terraform-module => generator/tfmod/resources/dashboard/template}/versions.tf (100%) create mode 100644 internal/generator/tfmod/resources/monitor/resource.go rename internal/{cmd/iac/template/terraform-module/monitor => generator/tfmod/resources/monitor/template}/main.tf.gotpl (52%) rename internal/{cmd/iac/template/terraform-module/monitor => generator/tfmod/resources/monitor/template}/outputs.tf.gotpl (52%) rename internal/{cmd/iac/template/terraform-module/monitor => generator/tfmod/resources/monitor/template}/variables.tf (100%) rename {specs/iac/import/dashboard/snapshot => internal/generator/tfmod/resources/monitor/template}/versions.tf (100%) create mode 100644 internal/helpers/osfs/file.go create mode 100644 internal/helpers/osfs/file_test.go create mode 100644 internal/helpers/osfs/render.go create mode 100644 internal/helpers/osfs/render_test.go create mode 100644 internal/helpers/prettier/json.go create mode 100644 internal/helpers/prettier/json_test.go create mode 100644 internal/helpers/prettier/space.go create mode 100644 internal/helpers/prettier/space_test.go create mode 100644 internal/helpers/types/codec.go create mode 100644 internal/helpers/types/float.go create mode 100644 internal/helpers/types/string.go create mode 100644 internal/magefiles/test.go delete mode 100644 internal/testing/specs/iac/import.spec delete mode 100644 specs/iac/import/console.spec.md create mode 100644 specs/iac/import/console/console.spec.md rename specs/iac/import/{ => console}/dashboard/input.json (100%) rename specs/iac/import/{ => console}/dashboard/snapshot/main.tf (100%) rename specs/iac/import/{ => console}/dashboard/snapshot/manifest.json (100%) rename specs/iac/import/{ => console}/dashboard/snapshot/outputs.tf (100%) rename specs/iac/import/{ => console}/dashboard/snapshot/variables.tf (100%) rename specs/iac/import/{monitor => console/dashboard}/snapshot/versions.tf (100%) rename specs/iac/import/{ => console}/monitor/input.json (100%) rename specs/iac/import/{ => console}/monitor/snapshot/main.tf (100%) rename specs/iac/import/{ => console}/monitor/snapshot/manifest-001.json (100%) rename specs/iac/import/{ => console}/monitor/snapshot/manifest-002.json (100%) rename specs/iac/import/{ => console}/monitor/snapshot/outputs.tf (100%) rename specs/iac/import/{ => console}/monitor/snapshot/variables.tf (100%) create mode 100644 specs/iac/import/console/monitor/snapshot/versions.tf delete mode 100644 specs/iac/import/grafana.spec.md create mode 100644 specs/iac/import/grafana/config/datakit.conf create mode 100644 specs/iac/import/grafana/config/docker-compose.yml create mode 100644 specs/iac/import/grafana/config/preview.png create mode 100644 specs/iac/import/grafana/config/prom.conf create mode 100644 specs/iac/import/grafana/grafana.spec.md create mode 100644 specs/iac/import/grafana/input.json create mode 100644 specs/iac/import/grafana/snapshot/main.tf create mode 100644 specs/iac/import/grafana/snapshot/manifest.json create mode 100644 specs/iac/import/grafana/snapshot/outputs.tf create mode 100644 specs/iac/import/grafana/snapshot/variables.tf create mode 100644 specs/iac/import/grafana/snapshot/versions.tf diff --git a/.github/PULL_REQUEST_TEMPLATE/proposal.md b/.github/PULL_REQUEST_TEMPLATE/proposal.md index a1b5cb6..78ff6f6 100644 --- a/.github/PULL_REQUEST_TEMPLATE/proposal.md +++ b/.github/PULL_REQUEST_TEMPLATE/proposal.md @@ -1,4 +1,4 @@ # Proposal [Number]: [Proposal Name] -* Proposal: [Preview Link]() -* Has Proof of Concept: (Yes/No) +- Proposal: [Preview Link]() +- Has Proof of Concept: (Yes/No) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index fce7a28..4babb0b 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: 1.18 + go-version: 1.19 - uses: actions/checkout@v3 - name: golangci-lint uses: golangci/golangci-lint-action@v3 @@ -43,3 +43,17 @@ jobs: # Optional: if set to true then the action don't cache or restore ~/.cache/go-build. # skip-build-cache: true + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 1.19 + - name: Run Unit Test + run: ./hack/make -v test:unit +# - run: curl -SsL https://downloads.gauge.org/stable | sh -s -- --location=/usr/local/bin +# - name: Run Acceptance Test +# run: ./hack/make -v test:acc diff --git a/.gitignore b/.gitignore index 7c866f8..97a295b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,8 +16,9 @@ coverage.txt # vendor/ # Output file -# Docs .build/ +out/ + # VS Code extension *.vsix @@ -31,7 +32,7 @@ rl.sh dist/ test.output tmp/ -internal/testing/specs/*.spec +internal/testing/specs/ # Local Netlify folder .netlify @@ -40,3 +41,6 @@ internal/testing/specs/*.spec .vscode/ .idea/ *.swp + +# Config with credentials +datakit.conf diff --git a/.markdownlint.yml b/.markdownlint.yml index fc94615..411184d 100644 --- a/.markdownlint.yml +++ b/.markdownlint.yml @@ -1,2 +1,3 @@ # disable line-length MD013: false +MD033: false diff --git a/.prettierignore b/.prettierignore index e796b66..5c5f494 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,3 @@ +specs + *.go diff --git a/README.md b/README.md index 8ed76cf..aaaf060 100644 --- a/README.md +++ b/README.md @@ -11,17 +11,17 @@ A command-line tool to help users interact with Guance Cloud. ## Features -| Topic | Feature | Proposals | User Specification | Related Projects | -| -------------------------------------- | ----------------- |-----------------------------------------------------------| ---------------------------------------- | ------------------------------------------------------------ | -| 🔧 _Command-line Interface_ | **Core** | [A001](./proposals/A001-guance-cli-overview.md) | [View](specs/guance.spec.md) | This repository | -| 🚅 _Resource Exporter_ | **Console** | WIP | [View](specs/iac/import/console.spec.md) | [![terraform-guance-dashboard](https://img.shields.io/badge/guance-terraform--guance--dashboard-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/terraform-guance-dashboard)
[![terraform-guance-monitor](https://img.shields.io/badge/guance-terraform--guance--monitor-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/terraform-guance-monitor) | -| | **Grafana** | [C002](./proposals/C002-importer-grafana.md) | [View](specs/iac/import/grafana.spec.md) | [![json-model](https://img.shields.io/badge/guance-json--model-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/json-model) | -| 🚀 _Continuation Integration / Testing_ | **JMeter** | [C001](./proposals/C001-continuous-integration-jmeter.md) | WIP | [![jmeter](https://img.shields.io/badge/apache-jmeter-blue?style=flat-square&logo=github)](https://github.com/apache/jmeter) | -| | **JUnit** | WIP | WIP | [![junit](https://img.shields.io/badge/junit--team-junit5-blue?style=flat-square&logo=github)](https://github.com/junit-team/junit5) | -| 📦 *Components Installer* | **DataKit** | WIP | WIP | [![DataKit](https://img.shields.io/badge/guance-DataKit-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/DataKit) | -| | **SCheck** | WIP | WIP | [![SCheck](https://img.shields.io/badge/guance-SCheck-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/SCheck) | -| 🔭 _Ecosystem Integration_ | **GitHub Action** | - | WIP | [![setup-guance](https://img.shields.io/badge/guance-setup--guance-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/setup-guance) | -| | **DevContainer** | - | WIP | WIP | +| Topic | Feature | Proposals | User Specification | Related Projects | +| --------------------------------------- | ----------------- | --------------------------------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| 🔧 _Command-line Interface_ | **Core** | [A001](./proposals/A001-guance-cli-overview.md) | [View](specs/guance.spec.md) | - | +| 🚅 _Resource Exporter_ | **Console** | - | [View](specs/iac/import/console/console.spec.md) | [![terraform-guance-dashboard](https://img.shields.io/badge/guance-terraform--guance--dashboard-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/terraform-guance-dashboard)
[![terraform-guance-monitor](https://img.shields.io/badge/guance-terraform--guance--monitor-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/terraform-guance-monitor) | +| | **Grafana** | [C002](./proposals/C002-importer-grafana.md) | [View](specs/iac/import/grafana/grafana.spec.md) | [![json-model](https://img.shields.io/badge/guance-json--model-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/json-model) | +| 🚀 _Continuation Integration / Testing_ | **JMeter** | [C001](./proposals/C001-continuous-integration-jmeter.md) | WIP | [![jmeter](https://img.shields.io/badge/apache-jmeter-blue?style=flat-square&logo=github)](https://github.com/apache/jmeter) | +| | **JUnit** | WIP | WIP | [![junit](https://img.shields.io/badge/junit--team-junit5-blue?style=flat-square&logo=github)](https://github.com/junit-team/junit5) | +| 📦 _Components Installer_ | **DataKit** | WIP | WIP | [![DataKit](https://img.shields.io/badge/guance-DataKit-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/DataKit) | +| | **SCheck** | WIP | WIP | [![SCheck](https://img.shields.io/badge/guance-SCheck-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/SCheck) | +| 🔭 _Ecosystem Integration_ | **GitHub Action** | - | WIP | [![setup-guance](https://img.shields.io/badge/guance-setup--guance-blue?style=flat-square&logo=github)](https://github.com/GuanceCloud/setup-guance) | +| | **DevContainer** | - | WIP | WIP | References: diff --git a/docs/references/guance.md b/docs/references/guance.md index 82c72ca..04024d8 100644 --- a/docs/references/guance.md +++ b/docs/references/guance.md @@ -12,4 +12,4 @@ Guance Cloud Command-Line Interface - [guance iac](guance_iac.md) - Infrastructure as Code -###### Auto generated by spf13/cobra on 8-May-2023 +###### Auto generated by spf13/cobra on 6-Jun-2023 diff --git a/docs/references/guance_iac.md b/docs/references/guance_iac.md index c87b28f..97d36b6 100644 --- a/docs/references/guance_iac.md +++ b/docs/references/guance_iac.md @@ -13,4 +13,4 @@ Infrastructure as Code - [guance](guance.md) - Guance Cloud Command-Line Interface - [guance iac import](guance_iac_import.md) - Import external resource as Guance Cloud IaC resource -###### Auto generated by spf13/cobra on 8-May-2023 +###### Auto generated by spf13/cobra on 6-Jun-2023 diff --git a/docs/references/guance_iac_import.md b/docs/references/guance_iac_import.md index f28a867..8620acc 100644 --- a/docs/references/guance_iac_import.md +++ b/docs/references/guance_iac_import.md @@ -2,22 +2,16 @@ Import external resource as Guance Cloud IaC resource -``` -guance iac import [flags] -``` - ### Options ``` - -f, --file string File path to import. - -h, --help help for import - -o, --out string Output file path. - -r, --resource string Source type, supports dashboard, monitor now. - -t, --target string Target type, supports terraform-module now. + -h, --help help for import ``` ### SEE ALSO - [guance iac](guance_iac.md) - Infrastructure as Code +- [guance iac import console](guance_iac_import_console.md) - Import Guance Cloud Console resources +- [guance iac import grafana](guance_iac_import_grafana.md) - (Alpha) Import grafana resources -###### Auto generated by spf13/cobra on 8-May-2023 +###### Auto generated by spf13/cobra on 6-Jun-2023 diff --git a/docs/references/guance_iac_import_console.md b/docs/references/guance_iac_import_console.md new file mode 100644 index 0000000..24de310 --- /dev/null +++ b/docs/references/guance_iac_import_console.md @@ -0,0 +1,23 @@ +## guance iac import console + +Import Guance Cloud Console resources + +``` +guance iac import console [flags] +``` + +### Options + +``` + -f, --file string File path to import. + -h, --help help for console + -o, --out string Output file path. + -r, --resource string Source type, supports dashboard, monitor now. + -t, --target string Target type, supports terraform-module now. +``` + +### SEE ALSO + +- [guance iac import](guance_iac_import.md) - Import external resource as Guance Cloud IaC resource + +###### Auto generated by spf13/cobra on 6-Jun-2023 diff --git a/docs/references/guance_iac_import_grafana.md b/docs/references/guance_iac_import_grafana.md new file mode 100644 index 0000000..377282d --- /dev/null +++ b/docs/references/guance_iac_import_grafana.md @@ -0,0 +1,22 @@ +## guance iac import grafana + +(Alpha) Import grafana resources + +``` +guance iac import grafana [flags] +``` + +### Options + +``` + -f, --file string File path to import. + -h, --help help for grafana + -o, --out string Output file path. + -t, --target string Target type, supports terraform-module now. +``` + +### SEE ALSO + +- [guance iac import](guance_iac_import.md) - Import external resource as Guance Cloud IaC resource + +###### Auto generated by spf13/cobra on 6-Jun-2023 diff --git a/docs/references/man/guance-iac-import-console.1 b/docs/references/man/guance-iac-import-console.1 new file mode 100644 index 0000000..df773ea --- /dev/null +++ b/docs/references/man/guance-iac-import-console.1 @@ -0,0 +1,48 @@ +.nh +.TH "GUANCE-IAC-IMPORT-CONSOLE" "1" "Jun 2023" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +guance-iac-import-console - Import Guance Cloud Console resources + + +.SH SYNOPSIS +.PP +\fBguance iac import console [flags]\fP + + +.SH DESCRIPTION +.PP +Import Guance Cloud Console resources + + +.SH OPTIONS +.PP +\fB-f\fP, \fB--file\fP="" + File path to import. + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for console + +.PP +\fB-o\fP, \fB--out\fP="" + Output file path. + +.PP +\fB-r\fP, \fB--resource\fP="" + Source type, supports dashboard, monitor now. + +.PP +\fB-t\fP, \fB--target\fP="" + Target type, supports terraform-module now. + + +.SH SEE ALSO +.PP +\fBguance-iac-import(1)\fP + + +.SH HISTORY +.PP +6-Jun-2023 Auto generated by spf13/cobra diff --git a/docs/references/man/guance-iac-import-grafana.1 b/docs/references/man/guance-iac-import-grafana.1 new file mode 100644 index 0000000..85a8695 --- /dev/null +++ b/docs/references/man/guance-iac-import-grafana.1 @@ -0,0 +1,44 @@ +.nh +.TH "GUANCE-IAC-IMPORT-GRAFANA" "1" "Jun 2023" "Auto generated by spf13/cobra" "" + +.SH NAME +.PP +guance-iac-import-grafana - (Alpha) Import grafana resources + + +.SH SYNOPSIS +.PP +\fBguance iac import grafana [flags]\fP + + +.SH DESCRIPTION +.PP +(Alpha) Import grafana resources + + +.SH OPTIONS +.PP +\fB-f\fP, \fB--file\fP="" + File path to import. + +.PP +\fB-h\fP, \fB--help\fP[=false] + help for grafana + +.PP +\fB-o\fP, \fB--out\fP="" + Output file path. + +.PP +\fB-t\fP, \fB--target\fP="" + Target type, supports terraform-module now. + + +.SH SEE ALSO +.PP +\fBguance-iac-import(1)\fP + + +.SH HISTORY +.PP +6-Jun-2023 Auto generated by spf13/cobra diff --git a/docs/references/man/guance-iac-import.1 b/docs/references/man/guance-iac-import.1 index d263faf..f8c1963 100644 --- a/docs/references/man/guance-iac-import.1 +++ b/docs/references/man/guance-iac-import.1 @@ -1,5 +1,5 @@ .nh -.TH "GUANCE-IAC-IMPORT" "1" "May 2023" "Auto generated by spf13/cobra" "" +.TH "GUANCE-IAC-IMPORT" "1" "Jun 2023" "Auto generated by spf13/cobra" "" .SH NAME .PP @@ -17,32 +17,16 @@ Import external resource as Guance Cloud IaC resource .SH OPTIONS -.PP -\fB-f\fP, \fB--file\fP="" - File path to import. - .PP \fB-h\fP, \fB--help\fP[=false] help for import -.PP -\fB-o\fP, \fB--out\fP="" - Output file path. - -.PP -\fB-r\fP, \fB--resource\fP="" - Source type, supports dashboard, monitor now. - -.PP -\fB-t\fP, \fB--target\fP="" - Target type, supports terraform-module now. - .SH SEE ALSO .PP -\fBguance-iac(1)\fP +\fBguance-iac(1)\fP, \fBguance-iac-import-console(1)\fP, \fBguance-iac-import-grafana(1)\fP .SH HISTORY .PP -8-May-2023 Auto generated by spf13/cobra +6-Jun-2023 Auto generated by spf13/cobra diff --git a/docs/references/man/guance-iac.1 b/docs/references/man/guance-iac.1 index 0d5b8e3..3a485d1 100644 --- a/docs/references/man/guance-iac.1 +++ b/docs/references/man/guance-iac.1 @@ -1,5 +1,5 @@ .nh -.TH "GUANCE-IAC" "1" "May 2023" "Auto generated by spf13/cobra" "" +.TH "GUANCE-IAC" "1" "Jun 2023" "Auto generated by spf13/cobra" "" .SH NAME .PP @@ -29,4 +29,4 @@ Infrastructure as Code .SH HISTORY .PP -8-May-2023 Auto generated by spf13/cobra +6-Jun-2023 Auto generated by spf13/cobra diff --git a/docs/references/man/guance.1 b/docs/references/man/guance.1 index 4bb206b..25c683d 100644 --- a/docs/references/man/guance.1 +++ b/docs/references/man/guance.1 @@ -1,5 +1,5 @@ .nh -.TH "GUANCE" "1" "May 2023" "Auto generated by spf13/cobra" "" +.TH "GUANCE" "1" "Jun 2023" "Auto generated by spf13/cobra" "" .SH NAME .PP @@ -29,4 +29,4 @@ Guance Cloud Command-Line Interface .SH HISTORY .PP -8-May-2023 Auto generated by spf13/cobra +6-Jun-2023 Auto generated by spf13/cobra diff --git a/go.mod b/go.mod index 67dcf07..d2799bf 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,8 @@ go 1.19 require ( github.com/hashicorp/go-multierror v1.1.1 github.com/magefile/mage v1.15.0 + github.com/mitchellh/mapstructure v1.5.0 + github.com/prometheus/prometheus v0.44.0 github.com/spf13/cobra v1.7.0 github.com/stretchr/testify v1.8.4 github.com/tidwall/gjson v1.14.4 @@ -12,14 +14,34 @@ require ( ) require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/hashicorp/errwrap v1.0.0 // indirect + github.com/dennwc/varint v1.0.0 // indirect + github.com/go-kit/log v0.2.1 // indirect + github.com/go-logfmt/logfmt v0.6.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect + github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_golang v1.15.0 // indirect + github.com/prometheus/client_model v0.3.0 // indirect + github.com/prometheus/common v0.42.0 // indirect + github.com/prometheus/procfs v0.9.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/tidwall/match v1.1.1 // indirect github.com/tidwall/pretty v1.2.0 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/goleak v1.2.1 // indirect + golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect + golang.org/x/sys v0.7.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 1d7ed3c..b945d88 100644 --- a/go.sum +++ b/go.sum @@ -1,17 +1,70 @@ +github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 h1:s6gZFSlWYmbqAuRjVTiNNhvNRfY2Wxp9nhfyel4rklc= +github.com/aws/aws-sdk-go v1.44.245 h1:KtY2s4q31/kn33AdV63R5t77mdxsI7rq3YT7Mgo805M= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= +github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cpuguy83/go-md2man/v2 v2.0.2 h1:p1EgwI/C7NhT0JmVkwCD2ZBK8j4aeHQX2pMHHBfMQ6w= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/dennwc/varint v1.0.0 h1:kGNFFSSw8ToIy3obO/kKr8U9GZYUAxQEVuix4zfDWzE= +github.com/dennwc/varint v1.0.0/go.mod h1:hnItb35rvZvJrbTALZtY/iQfDs48JKRG1RPpgziApxA= +github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU= +github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0= +github.com/go-logfmt/logfmt v0.6.0 h1:wGYYu3uicYdqXVgoYbvnkrPVXkuLM1p1ifugDMEdRi4= +github.com/go-logfmt/logfmt v0.6.0/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd h1:PpuIBO5P3e9hpqBD0O/HjhShYuM6XE0i/lbE6J94kww= +github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= +github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= +github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= +github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= +github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= +github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= +github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= +github.com/prometheus/common/sigv4 v0.1.0 h1:qoVebwtwwEhS85Czm2dSROY5fTo2PAPEVdDeppTwGX4= +github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= +github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/prometheus/prometheus v0.44.0 h1:sgn8Fdx+uE5tHQn0/622swlk2XnIj6udoZCnbVjHIgc= +github.com/prometheus/prometheus v0.44.0/go.mod h1:aPsmIK3py5XammeTguyqTmuqzX/jeCdyOWWobLHNKQg= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= @@ -29,7 +82,53 @@ github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.uber.org/atomic v1.10.0 h1:9qC72Qh0+3MqyJbAn8YU5xVq1frD8bn3JtD2oXtafVQ= +go.uber.org/atomic v1.10.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29 h1:ooxPy7fPvB4kwsA2h+iBNHkAbp/4JxTSwCmvdjEYmug= +golang.org/x/exp v0.0.0-20230321023759-10a507213a29/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM= +golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/cmd/iac/cmd.go b/internal/cmd/iac/cmd.go index 70cf373..6c891ba 100644 --- a/internal/cmd/iac/cmd.go +++ b/internal/cmd/iac/cmd.go @@ -1,59 +1,12 @@ package iac import ( - "bytes" _ "embed" - "encoding/json" - "fmt" - "os" - "path/filepath" - "text/template" "github.com/spf13/cobra" - "github.com/tidwall/gjson" - "github.com/tidwall/sjson" -) - -var ( - //go:embed template/terraform-module/versions.tf - templateTerraformVersion []byte - - //go:embed template/terraform-module/dashboard/main.tf - templateTerraformDashboard []byte - - //go:embed template/terraform-module/dashboard/outputs.tf - templateTerraformDashboardOutput []byte - - //go:embed template/terraform-module/dashboard/variables.tf - templateTerraformDashboardVar []byte - - //go:embed template/terraform-module/monitor/main.tf.gotpl - templateTerraformMonitor []byte - - //go:embed template/terraform-module/monitor/outputs.tf.gotpl - templateTerraformMonitorOutput []byte - - //go:embed template/terraform-module/monitor/variables.tf - templateTerraformMonitorVar []byte -) - -const ( - // SourceTypeConsole is the type from Guance Cloud Console - SourceTypeConsole = "console" -) - -const ( - // ResourceTypeDashboard is the type for Guance Cloud Dashboard - ResourceTypeDashboard = "dashboard" - // ResourceTypeMonitor is the type for Guance Cloud Monitor - ResourceTypeMonitor = "monitor" -) -const ( - // TargetTypeTerraform is the type for Terraform - TargetTypeTerraform = "terraform" - // TargetTypeTerraformModule is the type for Terraform Module - TargetTypeTerraformModule = "terraform-module" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/console" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana" ) // NewCmd create a new iac command @@ -66,164 +19,12 @@ func NewCmd() *cobra.Command { return cmd } -type importOptions struct { - Resource string - Target string - File string - Out string -} - -type genFile struct { - path string - content []byte -} - func newCmdImport() *cobra.Command { - opts := importOptions{} cmd := &cobra.Command{ - Use: "import", - Short: "Import external resource as Guance Cloud IaC resource", - Args: cobra.ExactArgs(1), - ValidArgs: []string{SourceTypeConsole}, - RunE: func(cmd *cobra.Command, args []string) error { - // The source must be imported from Guance Cloud Console now. - // Add more checking at here if we support more source type in the future. - - var files []*genFile - switch opts.Target { - case TargetTypeTerraformModule: - // Copy the manifest file import from console - content, err := os.ReadFile(opts.File) - if err != nil { - return fmt.Errorf("read file %s error: %w", opts.File, err) - } - - // Write the provider.tf - files = append(files, &genFile{path: "versions.tf", content: templateTerraformVersion}) - - // Write the resource file - switch opts.Resource { - case ResourceTypeDashboard: - files = append(files, &genFile{path: "manifest.json", content: content}) - files = append(files, &genFile{path: "main.tf", content: templateTerraformDashboard}) - files = append(files, &genFile{path: "variables.tf", content: templateTerraformDashboardVar}) - files = append(files, &genFile{path: "outputs.tf", content: templateTerraformDashboardOutput}) - case ResourceTypeMonitor: - var indices []string - jsonModifiers := []jsonModifier{fixNoData, formatJSON} - for i, value := range gjson.GetBytes(content, "checkers").Array() { - valueContent := []byte(value.String()) - for _, modifier := range jsonModifiers { - valueContent, err = modifier(valueContent) - if err != nil { - return fmt.Errorf("fix data error: %w", err) - } - } - files = append(files, &genFile{path: fmt.Sprintf("manifest-%03d.json", i+1), content: valueContent}) - indices = append(indices, fmt.Sprintf("%03d", i+1)) - } - outputFile, err := renderFile(templateTerraformMonitorOutput, indices) - if err != nil { - return fmt.Errorf("render outputs file error: %w", err) - } - files = append(files, &genFile{path: "outputs.tf", content: outputFile}) - mainFile, err := renderFile(templateTerraformMonitor, indices) - if err != nil { - return fmt.Errorf("render main file error: %w", err) - } - files = append(files, &genFile{path: "main.tf", content: mainFile}) - files = append(files, &genFile{path: "variables.tf", content: templateTerraformMonitorVar}) - default: - return fmt.Errorf("resource type %s not supported", opts.Resource) - } - default: - return fmt.Errorf("target type %s not supported", opts.Target) - } - for _, f := range files { - if err := writeFile(fmt.Sprintf("%s/%s", opts.Out, f.path), f.content); err != nil { - return fmt.Errorf("write file %s error: %w", f.path, err) - } - } - return nil - }, + Use: "import", + Short: "Import external resource as Guance Cloud IaC resource", } - cmd.Flags().StringVarP(&opts.Resource, "resource", "r", "", "Source type, supports dashboard, monitor now.") - cmd.Flags().StringVarP(&opts.File, "file", "f", "", "File path to import.") - cmd.Flags().StringVarP(&opts.Target, "target", "t", "", "Target type, supports terraform-module now.") - cmd.Flags().StringVarP(&opts.Out, "out", "o", "", "Output file path.") - _ = cmd.MarkFlagRequired("target") - _ = cmd.MarkFlagRequired("out") - cmd.MarkFlagsRequiredTogether("resource", "file") + cmd.AddCommand(console.NewCmd()) + cmd.AddCommand(grafana.NewCmd()) return cmd } - -func writeFile(dst string, content []byte) error { - if err := os.MkdirAll(filepath.Dir(dst), 0o755); err != nil { - return fmt.Errorf("mkdir %s error: %w", dst, err) - } - if err := os.WriteFile(dst, content, 0o600); err != nil { - return fmt.Errorf("write file %s error: %w", dst, err) - } - return nil -} - -func renderFile(templateContent []byte, data interface{}) ([]byte, error) { - tpl, err := template.New("guance").Parse(string(templateContent)) - if err != nil { - return nil, fmt.Errorf("parse template error: %w", err) - } - var buf bytes.Buffer - if err := tpl.Execute(&buf, data); err != nil { - return nil, fmt.Errorf("execute template error: %w", err) - } - return buf.Bytes(), nil -} - -type jsonModifier func([]byte) ([]byte, error) - -func fixNoData(src []byte) ([]byte, error) { - var err error - if gjson.GetBytes(src, "jsonScript.noDataPeriodCount").Int() == 0 { - src, err = sjson.DeleteBytes(src, "jsonScript.noDataPeriodCount") - if err != nil { - return nil, fmt.Errorf("delete noDataPeriodCount error: %w", err) - } - } - if gjson.GetBytes(src, "extend.noDataPeriodCount").Int() == 0 { - src, err = sjson.DeleteBytes(src, "extend.noDataPeriodCount") - if err != nil { - return nil, fmt.Errorf("delete noDataPeriodCount error: %w", err) - } - } - if gjson.GetBytes(src, "jsonScript.noDataMessage").String() == "" { - src, err = sjson.DeleteBytes(src, "jsonScript.noDataMessage") - if err != nil { - return nil, fmt.Errorf("delete noDataMessage error: %w", err) - } - } - if gjson.GetBytes(src, "jsonScript.noDataTitle").String() == "" { - src, err = sjson.DeleteBytes(src, "jsonScript.noDataTitle") - if err != nil { - return nil, fmt.Errorf("delete noDataTitle error: %w", err) - } - } - if !gjson.GetBytes(src, "jsonScript.checkerOpt.infoEvent").Bool() { - src, err = sjson.DeleteBytes(src, "jsonScript.checkerOpt.infoEvent") - if err != nil { - return nil, fmt.Errorf("delete infoEvent error: %w", err) - } - } - return src, nil -} - -func formatJSON(src []byte) ([]byte, error) { - var m interface{} - if err := json.Unmarshal(src, &m); err != nil { - return nil, fmt.Errorf("unmarshal json error when formatting: %w", err) - } - b, err := json.MarshalIndent(m, "", " ") - if err != nil { - return nil, fmt.Errorf("marshal json error when formatting: %w", err) - } - return b, nil -} diff --git a/internal/cmd/iac/import/console/cmd.go b/internal/cmd/iac/import/console/cmd.go new file mode 100644 index 0000000..e3990bb --- /dev/null +++ b/internal/cmd/iac/import/console/cmd.go @@ -0,0 +1,85 @@ +package console + +import ( + _ "embed" + "encoding/json" + "fmt" + "os" + + "github.com/GuanceCloud/guance-cli/internal/generator/tfmod/resources/dashboard" + "github.com/GuanceCloud/guance-cli/internal/generator/tfmod/resources/monitor" + + "github.com/GuanceCloud/guance-cli/internal/helpers/osfs" + "github.com/spf13/cobra" + "github.com/tidwall/gjson" +) + +const ( + // ResourceTypeDashboard is the type for Guance Cloud Dashboard + ResourceTypeDashboard = "dashboard" + // ResourceTypeMonitor is the type for Guance Cloud Monitor + ResourceTypeMonitor = "monitor" +) + +const ( + // TargetTypeTerraformModule is the type for Terraform Module + TargetTypeTerraformModule = "terraform-module" +) + +type importOptions struct { + Resource string + Target string + File string + Out string +} + +func NewCmd() *cobra.Command { + opts := importOptions{} + cmd := &cobra.Command{ + Use: "console", + Short: "Import Guance Cloud Console resources", + RunE: func(cmd *cobra.Command, args []string) error { + switch opts.Target { + case TargetTypeTerraformModule: + return generateTerraformModule(opts) + default: + return fmt.Errorf("target type %s not supported", opts.Target) + } + }, + } + cmd.Flags().StringVarP(&opts.Resource, "resource", "r", "", "Source type, supports dashboard, monitor now.") + cmd.Flags().StringVarP(&opts.File, "file", "f", "", "File path to import.") + cmd.Flags().StringVarP(&opts.Target, "target", "t", "", "Target type, supports terraform-module now.") + cmd.Flags().StringVarP(&opts.Out, "out", "o", "", "Output file path.") + _ = cmd.MarkFlagRequired("target") + _ = cmd.MarkFlagRequired("out") + cmd.MarkFlagsRequiredTogether("resource", "file") + return cmd +} + +func generateTerraformModule(opts importOptions) error { + content, err := os.ReadFile(opts.File) + if err != nil { + return fmt.Errorf("read file %s error: %w", opts.File, err) + } + var files osfs.Files + switch opts.Resource { + case ResourceTypeDashboard: + files, err = dashboard.Generate(dashboard.Options{Manifest: content}) + case ResourceTypeMonitor: + var monitors []json.RawMessage + for _, value := range gjson.GetBytes(content, "checkers").Array() { + monitors = append(monitors, json.RawMessage(value.Raw)) + } + files, err = monitor.Generate(monitor.Options{Manifests: monitors}) + default: + return fmt.Errorf("resource type %s not supported", opts.Resource) + } + if err != nil { + return fmt.Errorf("generate terraform module error: %w", err) + } + if err = files.Save(opts.Out); err != nil { + return fmt.Errorf("save terraform module error: %w", err) + } + return nil +} diff --git a/internal/cmd/iac/import/grafana/builder.go b/internal/cmd/iac/import/grafana/builder.go new file mode 100644 index 0000000..edde320 --- /dev/null +++ b/internal/cmd/iac/import/grafana/builder.go @@ -0,0 +1,135 @@ +package grafana + +import ( + "fmt" + "sync" + + "github.com/hashicorp/go-multierror" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/datasources/prometheus" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/spec" + "github.com/GuanceCloud/guance-cli/internal/helpers/types" +) + +const DefaultMeasurement = "prom" + +// Builder is the builder of Grafana dashboard +type Builder struct { + Measurement string + groups []string + charts []map[string]any + mu sync.Mutex +} + +// NewBuilder creates a new builder +func NewBuilder() *Builder { + return &Builder{ + Measurement: DefaultMeasurement, + groups: make([]string, 0), + charts: make([]map[string]any, 0), + mu: sync.Mutex{}, + } +} + +// Build will build Guance Cloud dashboard from Grafana dashboard +func (b *Builder) Build(src *spec.Spec) (map[string]any, error) { + b.reset() + + // Build prometheus builder + promBuilder := &prometheus.Builder{ + Measurement: b.Measurement, + } + + // Build panels + var mErr error + for _, panel := range src.Panels { + if err := b.acceptPanel(panel); err != nil { + mErr = multierror.Append(mErr, err) + } + } + if mErr != nil { + return nil, fmt.Errorf("failed to build dashboard: %w", mErr) + } + + // Build Variables + variables, err := promBuilder.BuildVariables(src.Templating.List) + if err != nil { + return nil, fmt.Errorf("failed to build variables: %w", err) + } + + return map[string]any{ + "dashboardBindSet": []string{}, + "dashboardExtend": map[string]any{}, + "dashboardMapping": []string{}, + "dashboardOwnerType": "node", + "dashboardType": "CUSTOM", + "iconSet": map[string]any{}, + "main": map[string]any{ + "charts": b.charts, + "groups": b.groups, + "type": "template", + "vars": variables, + }, + "summary": types.StringValue(src.Description), + "title": types.StringValue(src.Title), + "thumbnail": "", + "tags": src.Tags, + "tagInfo": []any{}, + }, nil +} + +func (b *Builder) acceptPanel(v any) error { + m := v.(map[string]any) + chartType, ok := m["type"].(string) + if !ok { + return fmt.Errorf("failed to get chart type") + } + delete(m, "datasource") + + // Convert Grafana row as Guance Cloud group + if chartType == "row" { + panel := &spec.RowPanel{} + if err := types.Decode(m, &panel); err != nil { + return fmt.Errorf("failed to decode row panel: %w", err) + } + b.groups = append(b.groups, types.StringValue(panel.Title)) + + if len(panel.Panels) > 0 { + for _, p := range panel.Panels { + if err := b.acceptPanel(p); err != nil { + return err + } + } + } + return nil + } + + // Convert Grafana panel to Guance Cloud chart + builder := charts.NewChartBuilder(chartType) + chartManifest, err := builder.Build(m, chart.BuildOptions{ + Group: b.currentGroup(), + Measurement: "prom", + }) + if err != nil { + return fmt.Errorf("failed to build chart: %w", err) + } + b.charts = append(b.charts, chartManifest) + return nil +} + +func (b *Builder) currentGroup() string { + if len(b.groups) == 0 { + return "" + } + return b.groups[len(b.groups)-1] +} + +func (b *Builder) reset() { + b.mu.Lock() + defer b.mu.Unlock() + + b.groups = nil + b.charts = nil +} diff --git a/internal/cmd/iac/import/grafana/chart/chart.go b/internal/cmd/iac/import/grafana/chart/chart.go new file mode 100644 index 0000000..0355935 --- /dev/null +++ b/internal/cmd/iac/import/grafana/chart/chart.go @@ -0,0 +1,10 @@ +package chart + +type BuildOptions struct { + Group string + Measurement string +} + +type Builder interface { + Build(m map[string]any, opts BuildOptions) (map[string]any, error) +} diff --git a/internal/cmd/iac/import/grafana/charts/all.go b/internal/cmd/iac/import/grafana/charts/all.go new file mode 100644 index 0000000..8ac2aa8 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/all.go @@ -0,0 +1,47 @@ +package charts + +import ( + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/bargauge" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/gauge" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/stat" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/table" + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/timeseries" +) + +const ( + ChartTypeTimeSeries = "timeseries" + ChartTypeBarGauge = "bargauge" + ChartTypeGauge = "gauge" + ChartTypeHeatmap = "heatmap" + ChartTypeStat = "stat" + ChartTypeTable = "table" +) + +const ( + GuanceChartTypeSequence = "sequence" + GuanceChartTypeSingleStat = "singlestat" + GuanceChartTypeTable = "table" + GuanceChartTypeGauge = "gauge" + GuanceChartTypeHeatmap = "heatmap" + GuanceChartTypeBar = "bar" +) + +var charts map[string]chart.Builder + +func init() { + charts = make(map[string]chart.Builder) + charts[ChartTypeTimeSeries] = ×eries.ChartBuilder{Type: GuanceChartTypeSequence} + charts[ChartTypeBarGauge] = &bargauge.ChartBuilder{Type: GuanceChartTypeBar} + charts[ChartTypeGauge] = &gauge.ChartBuilder{Type: GuanceChartTypeGauge} + charts[ChartTypeHeatmap] = &dummyChartBuilder{Type: GuanceChartTypeHeatmap} + charts[ChartTypeStat] = &stat.ChartBuilder{Type: GuanceChartTypeSingleStat} + charts[ChartTypeTable] = &table.ChartBuilder{Type: GuanceChartTypeTable} +} + +func NewChartBuilder(chartType string) chart.Builder { + if b, ok := charts[chartType]; ok { + return b + } + return &dummyChartBuilder{Type: chartType} +} diff --git a/internal/cmd/iac/import/grafana/charts/bargauge/bargauge.go b/internal/cmd/iac/import/grafana/charts/bargauge/bargauge.go new file mode 100644 index 0000000..daa6446 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/bargauge/bargauge.go @@ -0,0 +1,67 @@ +package bargauge + +import ( + "fmt" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/datasources/prometheus" + grafanaspec "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/spec" + "github.com/GuanceCloud/guance-cli/internal/helpers/types" +) + +type ChartBuilder struct { + Type string +} + +func (builder *ChartBuilder) Build(m map[string]any, opts chart.BuildOptions) (chart map[string]any, err error) { + delete(m, "datasource") + + panel := grafanaspec.Panel{} + if err := types.Decode(m, &panel); err != nil { + return nil, fmt.Errorf("failed to decode panel: %w", err) + } + + queries, err := (&prometheus.Builder{ + Measurement: opts.Measurement, + ChartType: builder.Type, + }).BuildTargets(panel.Targets) + if err != nil { + return nil, fmt.Errorf("failed to build targets: %w", err) + } + + return map[string]any{ + "type": builder.Type, + "name": types.StringValue(panel.Title), + "pos": map[string]any{ + "h": panel.GridPos.H, + "w": panel.GridPos.W, + "x": panel.GridPos.X, + "y": panel.GridPos.Y, + }, + "queries": queries, + "group": map[string]any{ + "name": types.String(opts.Group), + }, + "extend": map[string]any{ + "settings": map[string]any{ + "showTitle": true, + "titleDesc": types.StringValue(panel.Description), + "showFieldMapping": false, + "isTimeInterval": false, + "fixedTime": "", + "timeInterval": "default", + "direction": "vertical", + "showTopSize": false, + "topSize": 10, + "showTopWithMetric": "", + "xAxisShowType": "groupBy", + "showLine": false, + "openCompare": false, + "openStack": false, + "stackContent": "group", + "stackType": "time", + }, + }, + }, nil +} diff --git a/internal/cmd/iac/import/grafana/charts/bargauge/bargauge_test.go b/internal/cmd/iac/import/grafana/charts/bargauge/bargauge_test.go new file mode 100644 index 0000000..90f2fc1 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/bargauge/bargauge_test.go @@ -0,0 +1,56 @@ +package bargauge_test + +import ( + "encoding/json" + "os" + "testing" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/stretchr/testify/assert" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/bargauge" +) + +func TestChartBuilder_Build(t *testing.T) { + for _, tt := range []struct { + name string + grafana string + guance string + }{ + { + name: "ok", + grafana: "testdata/gauge.grafana.json", + guance: "testdata/gauge.guance.json", + }, + } { + t.Run(tt.name, func(t *testing.T) { + input := make(map[string]any) + inputJSON, err := os.ReadFile(tt.grafana) + if !assert.NoError(t, err) { + t.FailNow() + } + if err := json.Unmarshal(inputJSON, &input); !assert.NoError(t, err) { + t.FailNow() + } + + builder := bargauge.ChartBuilder{Type: "bar"} + actual, err := builder.Build(input, chart.BuildOptions{Measurement: "prom"}) + if !assert.NoError(t, err) { + t.FailNow() + } + actualJSON, err := json.Marshal(actual) + if !assert.NoError(t, err) { + t.FailNow() + } + + expectedJSON, err := os.ReadFile(tt.guance) + if !assert.NoError(t, err) { + t.FailNow() + } + if !assert.JSONEq(t, string(expectedJSON), string(actualJSON)) { + t.Log(string(actualJSON)) + } + }) + } +} diff --git a/internal/cmd/iac/import/grafana/charts/bargauge/testdata/gauge.grafana.json b/internal/cmd/iac/import/grafana/charts/bargauge/testdata/gauge.grafana.json new file mode 100644 index 0000000..ff16010 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/bargauge/testdata/gauge.grafana.json @@ -0,0 +1,51 @@ +{ + "datasource": "$datasource", + "description": "Total number of request in 24 hours for 200 response by nginx server", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "yellow", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 7, + "x": 17, + "y": 17 + }, + "id": 39, + "options": { + "displayMode": "gradient", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "mean" + ], + "values": false + }, + "showUnfilled": true + }, + "pluginVersion": "7.0.1", + "targets": [ + { + "expr": "sum_over_time(nginxlog_resp_bytes{instance=~\"$instance*\", resp_code=~\"200\"}[24h])", + "interval": "", + "legendFormat": "{{request}}", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Total Response 200 Req. [24h]", + "type": "bargauge" +} \ No newline at end of file diff --git a/internal/cmd/iac/import/grafana/charts/bargauge/testdata/gauge.guance.json b/internal/cmd/iac/import/grafana/charts/bargauge/testdata/gauge.guance.json new file mode 100644 index 0000000..6554563 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/bargauge/testdata/gauge.guance.json @@ -0,0 +1,49 @@ +{ + "extend": { + "settings": { + "direction": "vertical", + "fixedTime": "", + "isTimeInterval": false, + "openCompare": false, + "openStack": false, + "showFieldMapping": false, + "showLine": false, + "showTitle": true, + "showTopSize": false, + "showTopWithMetric": "", + "stackContent": "group", + "stackType": "time", + "timeInterval": "default", + "titleDesc": "Total number of request in 24 hours for 200 response by nginx server", + "topSize": 10, + "xAxisShowType": "groupBy" + } + }, + "group": { + "name": "" + }, + "name": "Total Response 200 Req. [24h]", + "pos": { + "h": 9, + "w": 7, + "x": 17, + "y": 17 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "sum_over_time(prom:nginxlog_resp_bytes{instance=~\"#{instance}*\",resp_code=~\"200\"}[1d])", + "type": "promql" + }, + "type": "bar" + } + ], + "type": "bar" +} \ No newline at end of file diff --git a/internal/cmd/iac/import/grafana/charts/dummy.go b/internal/cmd/iac/import/grafana/charts/dummy.go new file mode 100644 index 0000000..d0911ef --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/dummy.go @@ -0,0 +1,15 @@ +package charts + +import ( + "fmt" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" +) + +type dummyChartBuilder struct { + Type string +} + +func (builder *dummyChartBuilder) Build(m map[string]any, opts chart.BuildOptions) (chart map[string]any, err error) { + return chart, fmt.Errorf("chart type %s not implemented", builder.Type) +} diff --git a/internal/cmd/iac/import/grafana/charts/gauge/gauge.go b/internal/cmd/iac/import/grafana/charts/gauge/gauge.go new file mode 100644 index 0000000..5708856 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/gauge/gauge.go @@ -0,0 +1,85 @@ +package gauge + +import ( + "fmt" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/datasources/prometheus" + grafanaspec "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/spec" + "github.com/GuanceCloud/guance-cli/internal/helpers/types" +) + +type ChartBuilder struct { + Type string +} + +func (builder *ChartBuilder) Build(m map[string]any, opts chart.BuildOptions) (chart map[string]any, err error) { + delete(m, "datasource") + + panel := grafanaspec.Panel{} + if err := types.Decode(m, &panel); err != nil { + return nil, fmt.Errorf("failed to decode panel: %w", err) + } + + queries, err := (&prometheus.Builder{ + Measurement: opts.Measurement, + ChartType: builder.Type, + }).BuildTargets(panel.Targets) + if err != nil { + return nil, fmt.Errorf("failed to build targets: %w", err) + } + + if panel.FieldConfig.Defaults.Thresholds.Mode != "absolute" { + return nil, fmt.Errorf("threshold mode only supported absolute") + } + + var currentTop float64 + var levels []map[string]any + stepCnt := len(panel.FieldConfig.Defaults.Thresholds.Steps) + for i := 0; i < stepCnt; i++ { + // the next step value in Grafana is the current value (current top) in Guance Cloud + currentStep := panel.FieldConfig.Defaults.Thresholds.Steps[i] + if i == stepCnt-1 { + currentTop = 100 + } else { + nextStep := panel.FieldConfig.Defaults.Thresholds.Steps[i+1] + currentTop = float64(types.Float32Value(nextStep.Value)) + } + levels = append(levels, map[string]any{ + "operation": "<=", + "value": []any{ + currentTop, + }, + "lineColor": currentStep.Color, + }) + } + + height := 10 // min-height + if panel.GridPos.H > height { + height = panel.GridPos.H + } + return map[string]any{ + "type": builder.Type, + "name": types.StringValue(panel.Title), + "pos": map[string]any{ + "h": height, + "w": panel.GridPos.W, + "x": panel.GridPos.X, + "y": panel.GridPos.Y, + }, + "queries": queries, + "group": map[string]any{ + "name": types.String(opts.Group), + }, + "extend": map[string]any{ + "settings": map[string]any{ + "showTitle": true, + "titleDesc": types.StringValue(panel.Description), + "showFieldMapping": false, + "timeInterval": "auto", + "levels": levels, + }, + }, + }, nil +} diff --git a/internal/cmd/iac/import/grafana/charts/gauge/gauge_test.go b/internal/cmd/iac/import/grafana/charts/gauge/gauge_test.go new file mode 100644 index 0000000..344260e --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/gauge/gauge_test.go @@ -0,0 +1,56 @@ +package gauge_test + +import ( + "encoding/json" + "os" + "testing" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/stretchr/testify/assert" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/gauge" +) + +func TestChartBuilder_Build(t *testing.T) { + for _, tt := range []struct { + name string + grafana string + guance string + }{ + { + name: "ok", + grafana: "testdata/gauge.grafana.json", + guance: "testdata/gauge.guance.json", + }, + } { + t.Run(tt.name, func(t *testing.T) { + input := make(map[string]any) + inputJSON, err := os.ReadFile(tt.grafana) + if !assert.NoError(t, err) { + t.FailNow() + } + if err := json.Unmarshal(inputJSON, &input); !assert.NoError(t, err) { + t.FailNow() + } + + builder := gauge.ChartBuilder{Type: "gauge"} + actual, err := builder.Build(input, chart.BuildOptions{Measurement: "prom"}) + if !assert.NoError(t, err) { + t.FailNow() + } + actualJSON, err := json.Marshal(actual) + if !assert.NoError(t, err) { + t.FailNow() + } + + expectedJSON, err := os.ReadFile(tt.guance) + if !assert.NoError(t, err) { + t.FailNow() + } + if !assert.JSONEq(t, string(expectedJSON), string(actualJSON)) { + t.Log(string(actualJSON)) + } + }) + } +} diff --git a/internal/cmd/iac/import/grafana/charts/gauge/testdata/gauge.grafana.json b/internal/cmd/iac/import/grafana/charts/gauge/testdata/gauge.grafana.json new file mode 100644 index 0000000..e9982ee --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/gauge/testdata/gauge.grafana.json @@ -0,0 +1,54 @@ +{ + "datasource": "$datasource", + "fieldConfig": { + "defaults": { + "custom": {}, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "semi-dark-orange", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 5, + "x": 14, + "y": 1 + }, + "id": 20, + "options": { + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "mean" + ], + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "7.0.1", + "targets": [ + { + "expr": "100 - (cpu_usage_idle{instance=~ \"$instance*\",cpu=\"cpu-total\"})", + "interval": "", + "legendFormat": "{{instance}}", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Current CPU Utilization %", + "type": "gauge" +} diff --git a/internal/cmd/iac/import/grafana/charts/gauge/testdata/gauge.guance.json b/internal/cmd/iac/import/grafana/charts/gauge/testdata/gauge.guance.json new file mode 100644 index 0000000..2cb9396 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/gauge/testdata/gauge.guance.json @@ -0,0 +1,53 @@ +{ + "extend": { + "settings": { + "levels": [ + { + "lineColor": "semi-dark-orange", + "operation": "\u003c=", + "value": [ + 80 + ] + }, + { + "lineColor": "red", + "operation": "\u003c=", + "value": [ + 100 + ] + } + ], + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "" + }, + "name": "Current CPU Utilization %", + "pos": { + "h": 10, + "w": 5, + "x": 14, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "100 - (prom:cpu_usage_idle{cpu=\"cpu-total\",instance=~\"#{instance}*\"})", + "type": "promql" + }, + "type": "gauge" + } + ], + "type": "gauge" +} \ No newline at end of file diff --git a/internal/cmd/iac/import/grafana/charts/stat/stat.go b/internal/cmd/iac/import/grafana/charts/stat/stat.go new file mode 100644 index 0000000..13fa343 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/stat/stat.go @@ -0,0 +1,68 @@ +package stat + +import ( + "fmt" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/datasources/prometheus" + grafanaspec "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/spec" + "github.com/GuanceCloud/guance-cli/internal/helpers/types" +) + +type ChartBuilder struct { + Type string +} + +func (builder *ChartBuilder) Build(m map[string]any, opts chart.BuildOptions) (chart map[string]any, err error) { + panel := grafanaspec.Panel{} + if err := types.Decode(m, &panel); err != nil { + return chart, fmt.Errorf("failed to decode panel: %w", err) + } + + queries, err := (&prometheus.Builder{ + Measurement: opts.Measurement, + ChartType: builder.Type, + }).BuildTargets(panel.Targets) + if err != nil { + return chart, fmt.Errorf("failed to build targets: %w", err) + } + + height := 5 // min-height + if panel.GridPos.H > height { + height = panel.GridPos.H + } + return map[string]any{ + "name": types.StringValue(panel.Title), + "pos": map[string]any{ + "h": height, + "w": panel.GridPos.W, + "x": panel.GridPos.X, + "y": panel.GridPos.Y, + }, + "queries": queries, + "group": map[string]any{ + "name": types.String(opts.Group), + }, + "extend": map[string]any{ + "settings": map[string]any{ + "showTitle": true, + "titleDesc": types.StringValue(panel.Description), + "showFieldMapping": false, + "isTimeInterval": false, + "fixedTime": "", + "timeInterval": "default", + "downsample": "last", + "showLine": false, + "showLineAxis": false, + "lineColor": "#3AB8FF", + "openCompare": false, + "compareType": "", + "bgColor": "", + "fontColor": "", + "precision": "2", + }, + }, + "type": builder.Type, + }, nil +} diff --git a/internal/cmd/iac/import/grafana/charts/stat/stat_test.go b/internal/cmd/iac/import/grafana/charts/stat/stat_test.go new file mode 100644 index 0000000..296b141 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/stat/stat_test.go @@ -0,0 +1,56 @@ +package stat_test + +import ( + "encoding/json" + "os" + "testing" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/stretchr/testify/assert" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/stat" +) + +func TestChartBuilder_Build(t *testing.T) { + for _, tt := range []struct { + name string + grafana string + guance string + }{ + { + name: "ok", + grafana: "testdata/stat.grafana.json", + guance: "testdata/stat.guance.json", + }, + } { + t.Run(tt.name, func(t *testing.T) { + input := make(map[string]any) + inputJSON, err := os.ReadFile(tt.grafana) + if !assert.NoError(t, err) { + t.FailNow() + } + if err := json.Unmarshal(inputJSON, &input); !assert.NoError(t, err) { + t.FailNow() + } + + builder := stat.ChartBuilder{Type: "stat"} + actual, err := builder.Build(input, chart.BuildOptions{Measurement: "prom"}) + if !assert.NoError(t, err) { + t.FailNow() + } + actualJSON, err := json.Marshal(actual) + if !assert.NoError(t, err) { + t.FailNow() + } + + expectedJSON, err := os.ReadFile(tt.guance) + if !assert.NoError(t, err) { + t.FailNow() + } + if !assert.JSONEq(t, string(expectedJSON), string(actualJSON)) { + t.Log(string(actualJSON)) + } + }) + } +} diff --git a/internal/cmd/iac/import/grafana/charts/stat/testdata/stat.grafana.json b/internal/cmd/iac/import/grafana/charts/stat/testdata/stat.grafana.json new file mode 100644 index 0000000..6dbf366 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/stat/testdata/stat.grafana.json @@ -0,0 +1,80 @@ +{ + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "System uptime", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 1, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 20, + "y": 1 + }, + "hideTimeOverride": true, + "id": 15, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_time_seconds{instance=\"$node\",job=\"$job\"} - node_boot_time_seconds{instance=\"$node\",job=\"$job\"}", + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "title": "Uptime", + "type": "stat" +} \ No newline at end of file diff --git a/internal/cmd/iac/import/grafana/charts/stat/testdata/stat.guance.json b/internal/cmd/iac/import/grafana/charts/stat/testdata/stat.guance.json new file mode 100644 index 0000000..9d48e87 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/stat/testdata/stat.guance.json @@ -0,0 +1,48 @@ +{ + "extend": { + "settings": { + "bgColor": "", + "compareType": "", + "downsample": "last", + "fixedTime": "", + "fontColor": "", + "isTimeInterval": false, + "lineColor": "#3AB8FF", + "openCompare": false, + "precision": "2", + "showFieldMapping": false, + "showLine": false, + "showLineAxis": false, + "showTitle": true, + "timeInterval": "default", + "titleDesc": "System uptime" + } + }, + "group": { + "name": "" + }, + "name": "Uptime", + "pos": { + "h": 5, + "w": 4, + "x": 20, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " prom:node_time_seconds{instance=\"#{node}\",job=\"#{job}\"}\n-\n prom:node_boot_time_seconds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "stat" + } + ], + "type": "stat" +} \ No newline at end of file diff --git a/internal/cmd/iac/import/grafana/charts/table/table.go b/internal/cmd/iac/import/grafana/charts/table/table.go new file mode 100644 index 0000000..8f43116 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/table/table.go @@ -0,0 +1,62 @@ +package table + +import ( + "fmt" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/datasources/prometheus" + grafanaspec "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/spec" + "github.com/GuanceCloud/guance-cli/internal/helpers/types" +) + +type ChartBuilder struct { + Type string +} + +func (builder *ChartBuilder) Build(m map[string]any, opts chart.BuildOptions) (chart map[string]any, err error) { + delete(m, "datasource") + + panel := grafanaspec.Panel{} + if err := types.Decode(m, &panel); err != nil { + return chart, fmt.Errorf("failed to decode panel: %w", err) + } + + queries, err := (&prometheus.Builder{ + Measurement: opts.Measurement, + ChartType: builder.Type, + }).BuildTargets(panel.Targets) + if err != nil { + return chart, fmt.Errorf("failed to build targets: %w", err) + } + + return map[string]any{ + "type": builder.Type, + "name": types.StringValue(panel.Title), + "pos": map[string]any{ + "h": panel.GridPos.H, + "w": panel.GridPos.W, + "x": panel.GridPos.X, + "y": panel.GridPos.Y, + }, + "queries": queries, + "group": map[string]any{ + "name": types.String(opts.Group), + }, + "extend": map[string]any{ + "settings": map[string]any{ + "showTitle": true, + "titleDesc": types.StringValue(panel.Description), + "showFieldMapping": false, + "isTimeInterval": false, + "fixedTime": "", + "timeInterval": "default", + "queryMode": "toGroupColumn", + "pageSize": 0, + "mainMeasurementQueryCode": "A", + "mainMeasurementSort": "top", + "mainMeasurementLimit": 20, + }, + }, + }, nil +} diff --git a/internal/cmd/iac/import/grafana/charts/table/table_test.go b/internal/cmd/iac/import/grafana/charts/table/table_test.go new file mode 100644 index 0000000..9af7214 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/table/table_test.go @@ -0,0 +1,56 @@ +package table_test + +import ( + "encoding/json" + "os" + "testing" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/stretchr/testify/assert" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/table" +) + +func TestChartBuilder_Build(t *testing.T) { + for _, tt := range []struct { + name string + grafana string + guance string + }{ + { + name: "ok", + grafana: "testdata/table.grafana.json", + guance: "testdata/table.guance.json", + }, + } { + t.Run(tt.name, func(t *testing.T) { + input := make(map[string]any) + inputJSON, err := os.ReadFile(tt.grafana) + if !assert.NoError(t, err) { + t.FailNow() + } + if err := json.Unmarshal(inputJSON, &input); !assert.NoError(t, err) { + t.FailNow() + } + + builder := table.ChartBuilder{Type: "table"} + actual, err := builder.Build(input, chart.BuildOptions{Measurement: "prom"}) + if !assert.NoError(t, err) { + t.FailNow() + } + actualJSON, err := json.Marshal(actual) + if !assert.NoError(t, err) { + t.FailNow() + } + + expectedJSON, err := os.ReadFile(tt.guance) + if !assert.NoError(t, err) { + t.FailNow() + } + if !assert.JSONEq(t, string(expectedJSON), string(actualJSON)) { + t.Log(string(actualJSON)) + } + }) + } +} diff --git a/internal/cmd/iac/import/grafana/charts/table/testdata/table.grafana.json b/internal/cmd/iac/import/grafana/charts/table/testdata/table.grafana.json new file mode 100644 index 0000000..4049496 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/table/testdata/table.grafana.json @@ -0,0 +1,223 @@ +{ + "datasource": "$datasource", + "fieldConfig": { + "defaults": { + "custom": { + "align": "center", + "displayMode": "auto" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 144 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "agent" + }, + "properties": [ + { + "id": "custom.width", + "value": 173 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "auth" + }, + "properties": [ + { + "id": "custom.width", + "value": 84 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "client_ip" + }, + "properties": [ + { + "id": "custom.width", + "value": 143 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "env" + }, + "properties": [ + { + "id": "custom.width", + "value": 20 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "exported_env" + }, + "properties": [ + { + "id": "custom.width", + "value": 122 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "ident" + }, + "properties": [ + { + "id": "custom.width", + "value": 74 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "job" + }, + "properties": [ + { + "id": "custom.width", + "value": 53 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "path" + }, + "properties": [ + { + "id": "custom.width", + "value": 151 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "referrer" + }, + "properties": [ + { + "id": "custom.width", + "value": 82 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "resp_code" + }, + "properties": [ + { + "id": "custom.width", + "value": 94 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "verb" + }, + "properties": [ + { + "id": "custom.width", + "value": 48 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "request" + }, + "properties": [ + { + "id": "custom.width", + "value": 208 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value" + }, + "properties": [ + { + "id": "custom.width", + "value": 29 + } + ] + } + ] + }, + "gridPos": { + "h": 16, + "w": 24, + "x": 0, + "y": 58 + }, + "id": 34, + "options": { + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "7.0.1", + "repeat": null, + "repeatDirection": "h", + "targets": [ + { + "expr": "nginxlog_resp_bytes{instance=~\"$instance*\"}", + "interval": "", + "legendFormat": "", + "refId": "A" + } + ], + "timeFrom": null, + "timeShift": null, + "title": "Each Request Detail", + "transformations": [ + { + "id": "labelsToFields", + "options": {} + } + ], + "type": "table" +} \ No newline at end of file diff --git a/internal/cmd/iac/import/grafana/charts/table/testdata/table.guance.json b/internal/cmd/iac/import/grafana/charts/table/testdata/table.guance.json new file mode 100644 index 0000000..b682ffa --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/table/testdata/table.guance.json @@ -0,0 +1,44 @@ +{ + "extend": { + "settings": { + "fixedTime": "", + "isTimeInterval": false, + "mainMeasurementLimit": 20, + "mainMeasurementQueryCode": "A", + "mainMeasurementSort": "top", + "pageSize": 0, + "queryMode": "toGroupColumn", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "default", + "titleDesc": "" + } + }, + "group": { + "name": "" + }, + "name": "Each Request Detail", + "pos": { + "h": 16, + "w": 24, + "x": 0, + "y": 58 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:nginxlog_resp_bytes{instance=~\"#{instance}*\"}", + "type": "promql" + }, + "type": "table" + } + ], + "type": "table" +} \ No newline at end of file diff --git a/internal/cmd/iac/import/grafana/charts/timeseries/testdata/timeseries.grafana.json b/internal/cmd/iac/import/grafana/charts/timeseries/testdata/timeseries.grafana.json new file mode 100644 index 0000000..404b768 --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/timeseries/testdata/timeseries.grafana.json @@ -0,0 +1,280 @@ +{ + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Basic CPU info", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "percent" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Busy Iowait" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Idle" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy Iowait" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Idle" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy System" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy User" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy Other" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 6 + }, + "id": 77, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true, + "width": 250 + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"system\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Busy System", + "range": true, + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"user\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Busy User", + "range": true, + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"iowait\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Busy Iowait", + "range": true, + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=~\".*irq\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Busy IRQs", + "range": true, + "refId": "D", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode!='idle',mode!='user',mode!='system',mode!='iowait',mode!='irq',mode!='softirq'}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Busy Other", + "range": true, + "refId": "E", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"idle\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Idle", + "range": true, + "refId": "F", + "step": 240 + } + ], + "title": "CPU Basic", + "type": "timeseries" +} \ No newline at end of file diff --git a/internal/cmd/iac/import/grafana/charts/timeseries/testdata/timeseries.guance.json b/internal/cmd/iac/import/grafana/charts/timeseries/testdata/timeseries.guance.json new file mode 100644 index 0000000..eb9dc4c --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/timeseries/testdata/timeseries.guance.json @@ -0,0 +1,108 @@ +{ + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Basic CPU info" + } + }, + "group": { + "name": "" + }, + "name": "CPU Basic", + "pos": { + "h": 7, + "w": 12, + "x": 0, + "y": 6 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"system\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"user\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"iowait\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=~\".*irq\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": " sum by (instance) (\n irate(\n prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode!=\"idle\",mode!=\"iowait\",mode!=\"irq\",mode!=\"softirq\",mode!=\"system\",mode!=\"user\"}\n )\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "F", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"idle\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" +} \ No newline at end of file diff --git a/internal/cmd/iac/import/grafana/charts/timeseries/timeseries.go b/internal/cmd/iac/import/grafana/charts/timeseries/timeseries.go new file mode 100644 index 0000000..b4505ca --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/timeseries/timeseries.go @@ -0,0 +1,56 @@ +package timeseries + +import ( + "fmt" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/datasources/prometheus" + grafanaspec "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/spec" + "github.com/GuanceCloud/guance-cli/internal/helpers/types" +) + +type ChartBuilder struct { + Type string +} + +func (builder *ChartBuilder) Build(m map[string]any, opts chart.BuildOptions) (chart map[string]any, err error) { + delete(m, "datasource") + + panel := grafanaspec.Panel{} + if err := types.Decode(m, &panel); err != nil { + return nil, fmt.Errorf("failed to decode panel: %w", err) + } + + queries, err := (&prometheus.Builder{ + Measurement: opts.Measurement, + ChartType: builder.Type, + }).BuildTargets(panel.Targets) + if err != nil { + return nil, fmt.Errorf("failed to build targets: %w", err) + } + + return map[string]any{ + "type": builder.Type, + "name": types.StringValue(panel.Title), + "pos": map[string]any{ + "h": panel.GridPos.H, + "w": panel.GridPos.W, + "x": panel.GridPos.X, + "y": panel.GridPos.Y, + }, + "queries": queries, + "group": map[string]any{ + "name": types.String(opts.Group), + }, + "extend": map[string]any{ + "settings": map[string]any{ + "showTitle": true, + "titleDesc": types.StringValue(panel.Description), + "showFieldMapping": false, + "timeInterval": "auto", + "chartType": "areaLine", + }, + }, + }, nil +} diff --git a/internal/cmd/iac/import/grafana/charts/timeseries/timeseries_test.go b/internal/cmd/iac/import/grafana/charts/timeseries/timeseries_test.go new file mode 100644 index 0000000..9f5c89e --- /dev/null +++ b/internal/cmd/iac/import/grafana/charts/timeseries/timeseries_test.go @@ -0,0 +1,56 @@ +package timeseries_test + +import ( + "encoding/json" + "os" + "testing" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/chart" + + "github.com/stretchr/testify/assert" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/charts/timeseries" +) + +func TestChartBuilder_Build(t *testing.T) { + for _, tt := range []struct { + name string + grafana string + guance string + }{ + { + name: "ok", + grafana: "testdata/timeseries.grafana.json", + guance: "testdata/timeseries.guance.json", + }, + } { + t.Run(tt.name, func(t *testing.T) { + input := make(map[string]any) + inputJSON, err := os.ReadFile(tt.grafana) + if !assert.NoError(t, err) { + t.FailNow() + } + if err := json.Unmarshal(inputJSON, &input); !assert.NoError(t, err) { + t.FailNow() + } + + builder := timeseries.ChartBuilder{Type: "sequence"} + actual, err := builder.Build(input, chart.BuildOptions{Measurement: "prom"}) + if !assert.NoError(t, err) { + t.FailNow() + } + actualJSON, err := json.Marshal(actual) + if !assert.NoError(t, err) { + t.FailNow() + } + + expectedJSON, err := os.ReadFile(tt.guance) + if !assert.NoError(t, err) { + t.FailNow() + } + if !assert.JSONEq(t, string(expectedJSON), string(actualJSON)) { + t.Log(string(actualJSON)) + } + }) + } +} diff --git a/internal/cmd/iac/import/grafana/cmd.go b/internal/cmd/iac/import/grafana/cmd.go new file mode 100644 index 0000000..0ec3c93 --- /dev/null +++ b/internal/cmd/iac/import/grafana/cmd.go @@ -0,0 +1,64 @@ +package grafana + +import ( + "encoding/json" + "fmt" + "os" + + "github.com/spf13/cobra" + + dashboardtfmod "github.com/GuanceCloud/guance-cli/internal/generator/tfmod/resources/dashboard" +) + +type importOptions struct { + Resource string + Target string + File string + Out string + Measurement string +} + +func NewCmd() *cobra.Command { + opts := importOptions{} + cmd := &cobra.Command{ + Use: "grafana", + Short: "(Alpha) Import Grafana Dashboard resources", + RunE: func(cmd *cobra.Command, args []string) error { + content, err := os.ReadFile(opts.File) + if err != nil { + return fmt.Errorf("read file error: %w", err) + } + + grafanaDashboard, err := ParseGrafana(content) + if err != nil { + return fmt.Errorf("parse grafana dashboard error: %w", err) + } + + builder := NewBuilder() + builder.Measurement = opts.Measurement + adt, err := builder.Build(grafanaDashboard) + if err != nil { + return fmt.Errorf("generate dashboard error: %w", err) + } + + manifest, err := json.Marshal(adt) + if err != nil { + return fmt.Errorf("marshal dashboard error: %w", err) + } + + files, err := dashboardtfmod.Generate(dashboardtfmod.Options{Manifest: manifest}) + if err != nil { + return fmt.Errorf("generate dashboard error: %w", err) + } + return files.Save(opts.Out) + }, + } + cmd.Flags().StringVarP(&opts.File, "file", "f", "", "File path to import.") + cmd.Flags().StringVarP(&opts.Target, "target", "t", "", "Target type, supports terraform-module now.") + cmd.Flags().StringVarP(&opts.Out, "out", "o", "", "Output file path.") + cmd.Flags().StringVarP(&opts.Measurement, "measurement", "m", "prom", "Measurement (default is prom).") + _ = cmd.MarkFlagRequired("target") + _ = cmd.MarkFlagRequired("out") + cmd.MarkFlagsRequiredTogether("file") + return cmd +} diff --git a/internal/cmd/iac/import/grafana/cmd_test.go b/internal/cmd/iac/import/grafana/cmd_test.go new file mode 100644 index 0000000..0cfbcb9 --- /dev/null +++ b/internal/cmd/iac/import/grafana/cmd_test.go @@ -0,0 +1,20 @@ +package grafana + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +// All test code is migrated to User Specification Test +// You can see the `specs/iac/import/grafana` folder for more details. + +func TestGrafana(t *testing.T) { + t.Skip() + + cmd := NewCmd() + cmd.SetArgs([]string{"-f", "testdata/node.json", "-t", "terraform-module", "-o", "testdata/output"}) + if err := cmd.Execute(); err != nil { + assert.NoError(t, err) + } +} diff --git a/internal/cmd/iac/import/grafana/datasources/prometheus/builder.go b/internal/cmd/iac/import/grafana/datasources/prometheus/builder.go new file mode 100644 index 0000000..319fbe5 --- /dev/null +++ b/internal/cmd/iac/import/grafana/datasources/prometheus/builder.go @@ -0,0 +1,7 @@ +package prometheus + +// Builder is the builder to convert Prometheus from Grafana Dashboard to Guance Cloud +type Builder struct { + Measurement string + ChartType string +} diff --git a/internal/cmd/iac/import/grafana/datasources/prometheus/promql.go b/internal/cmd/iac/import/grafana/datasources/prometheus/promql.go new file mode 100644 index 0000000..623e3f9 --- /dev/null +++ b/internal/cmd/iac/import/grafana/datasources/prometheus/promql.go @@ -0,0 +1,68 @@ +package prometheus + +import ( + "fmt" + "regexp" + "strings" + + "github.com/prometheus/prometheus/model/labels" + "github.com/prometheus/prometheus/promql/parser" +) + +// Rewriter is a rewriter to convert Grafana-specific PromQL to MetricsQL on Guance Cloud +type Rewriter struct { + Measurement string +} + +const magicInterval = "[999d]" + +// Rewrite will rewrite a query from Grafana-specific PromQL to MetricsQL on Guance Cloud +func (w *Rewriter) Rewrite(query string) (string, error) { + // Fix for Grafana-specific interval interpolation syntax + // See also: https://docs.guance.com/dql/metricsql/ + query = strings.ReplaceAll(query, "[$__interval]", magicInterval) + query = strings.ReplaceAll(query, "[$__rate_interval]", magicInterval) + + expr, err := parser.ParseExpr(query) + if err != nil { + return "", fmt.Errorf("failed to parse query %q: %w", query, err) + } + if err := parser.Walk(w, expr, nil); err != nil { + return "", fmt.Errorf("walk PromQL expression failed: %w", err) + } + return strings.ReplaceAll(parser.Prettify(expr), magicInterval, ""), nil +} + +func (w *Rewriter) Visit(node parser.Node, path []parser.Node) (v parser.Visitor, err error) { + if e, ok := node.(*parser.VectorSelector); ok { + e.Name = w.rewriteName(e.Name) + labelMatchers := make([]*labels.Matcher, 0) + for i := 0; i < len(e.LabelMatchers); i++ { + if e.LabelMatchers[i].Name == "__name__" { + continue + } + e.LabelMatchers[i].Value = w.rewriteVar(e.LabelMatchers[i].Value) + labelMatchers = append(labelMatchers, e.LabelMatchers[i]) + } + e.LabelMatchers = labelMatchers + } + return w, nil +} + +var varPattern = regexp.MustCompile(`\$\w+`) + +func (w *Rewriter) rewriteVar(name string) string { + return varPattern.ReplaceAllStringFunc(name, func(s string) string { + return fmt.Sprintf("#{%s}", s[1:]) + }) +} + +const nameSep = "_" + +func (w *Rewriter) rewriteName(name string) string { + if w.Measurement != "" { + return fmt.Sprintf("%s:%s", w.Measurement, name) + } + tokens := strings.Split(name, nameSep) + return fmt.Sprintf("%s:%s", tokens[0], strings.Join(tokens[1:], nameSep)) +} diff --git a/internal/cmd/iac/import/grafana/datasources/prometheus/promql_test.go b/internal/cmd/iac/import/grafana/datasources/prometheus/promql_test.go new file mode 100644 index 0000000..2d60ce0 --- /dev/null +++ b/internal/cmd/iac/import/grafana/datasources/prometheus/promql_test.go @@ -0,0 +1,85 @@ +package prometheus + +import ( + "testing" + + "github.com/GuanceCloud/guance-cli/internal/helpers/prettier" + "github.com/stretchr/testify/assert" +) + +func TestRewriter_Rewrite(t *testing.T) { + type fields struct { + Measurement string + } + type args struct { + query string + } + tests := []struct { + name string + fields fields + args args + want string + wantErr bool + }{ + { + name: "basic query", + fields: fields{ + Measurement: "prom", + }, + args: args{ + query: "sum(rate(container_cpu_usage_seconds_total{image!=\"\",name=~\"^k8s_.*\"}[5m])) by (pod_name)", + }, + want: "sum by (pod_name) (rate(prom:container_cpu_usage_seconds_total{image!=\"\", name=~\"^k8s_.*\"}[5m]))", + wantErr: false, + }, + { + name: "no measurement", + fields: fields{ + Measurement: "", + }, + args: args{ + query: "sum(rate(container_cpu_usage_seconds_total{image!=\"\",name=~\"^k8s_.*\"}[5m])) by (pod_name)", + }, + want: "sum by (pod_name) (rate(container:cpu_usage_seconds_total{image!=\"\", name=~\"^k8s_.*\"}[5m]))", + wantErr: false, + }, + { + name: "invalid query", + fields: fields{ + Measurement: "prom", + }, + args: args{ + query: "invalid query", + }, + want: "", + wantErr: true, + }, + { + name: "drop grafana interval", + fields: fields{ + Measurement: "prom", + }, + args: args{ + query: "irate(node_forks_total{instance=\"#{node}\",job=\"#{job}\"}[$__rate_interval])", + }, + want: "irate(prom:node_forks_total{instance=\"#{node}\",job=\"#{job}\"})", + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + w := &Rewriter{ + Measurement: tt.fields.Measurement, + } + got, err := w.Rewrite(tt.args.query) + if (err != nil) != tt.wantErr { + t.Errorf("Rewriter.Rewrite() error = %v, wantErr %v", err, tt.wantErr) + return + } + + if !assert.Equal(t, prettier.RemoveSpaces(tt.want), prettier.RemoveSpaces(got), "expected: %s, got: %s", tt.want, got) { + t.FailNow() + } + }) + } +} diff --git a/internal/cmd/iac/import/grafana/datasources/prometheus/target.go b/internal/cmd/iac/import/grafana/datasources/prometheus/target.go new file mode 100644 index 0000000..2791f17 --- /dev/null +++ b/internal/cmd/iac/import/grafana/datasources/prometheus/target.go @@ -0,0 +1,55 @@ +package prometheus + +import ( + "fmt" + + grafanaspec "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/spec" + "github.com/GuanceCloud/guance-cli/internal/helpers/types" + "github.com/hashicorp/go-multierror" +) + +// Target is the query target of Grafana +type Target struct { + Datasource any `json:"datasource"` + Expr string `json:"expr"` + Hide bool `json:"hide"` + Interval string `json:"interval"` + LegendFormat string `json:"legendFormat"` + RefID string `json:"refId"` +} + +// BuildTargets builds targets for Guance Cloud +func (builder *Builder) BuildTargets(targets []grafanaspec.Target) ([]any, error) { + var mErr error + queries := make([]any, 0, len(targets)) + for _, item := range targets { + target := Target{} + if err := types.Decode(item, &target); err != nil { + mErr = multierror.Append(mErr, fmt.Errorf("failed to decode target: %w", err)) + continue + } + promql, err := (&Rewriter{Measurement: builder.Measurement}).Rewrite(target.Expr) + if err != nil { + mErr = multierror.Append(mErr, fmt.Errorf("failed to rewrite promql: %w", err)) + continue + } + queries = append(queries, map[string]any{ + "qtype": "promql", + "query": map[string]any{ + "code": target.RefID, + "q": promql, + "type": "promql", + "funcList": []string{}, + }, + "type": builder.ChartType, + "datasource": "dataflux", + "color": "", + "name": "", + "disabled": target.Hide, + }) + } + if mErr != nil { + return nil, fmt.Errorf("failed to decode targets: %w", mErr) + } + return queries, nil +} diff --git a/internal/cmd/iac/import/grafana/datasources/prometheus/variable.go b/internal/cmd/iac/import/grafana/datasources/prometheus/variable.go new file mode 100644 index 0000000..b2cdef4 --- /dev/null +++ b/internal/cmd/iac/import/grafana/datasources/prometheus/variable.go @@ -0,0 +1,73 @@ +package prometheus + +import ( + "fmt" + "regexp" + + grafanaspec "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/spec" + "github.com/hashicorp/go-multierror" +) + +// BuildVariables builds variables for Guance Cloud +func (builder *Builder) BuildVariables(variables []grafanaspec.VariableModel) ([]any, error) { + var mErr error + vars := make([]any, 0, len(variables)) + for _, variable := range variables { + if variable.Type != "query" { + continue + } + + label, err := getLabelFromVariable(variable) + if err != nil { + mErr = multierror.Append(mErr, fmt.Errorf("failed to get label from variable: %w", err)) + continue + } + + vars = append(vars, map[string]any{ + "code": variable.Name, + "datasource": "dataflux", + "definition": map[string]any{ + "defaultVal": map[string]any{ + "label": "", + "value": "", + }, + "field": "", + "metric": "", + "object": "", + "tag": "", + "value": fmt.Sprintf("SHOW_TAG_VALUE(from=['%s'], keyin=['%s'])", builder.Measurement, label), + }, + "hide": 0, + "isHiddenAsterisk": 0, + "name": variable.Label, + "seq": 2, + "type": "QUERY", + "valueSort": "asc", + }) + } + if mErr != nil { + return nil, fmt.Errorf("failed to decode targets: %w", mErr) + } + return vars, nil +} + +var labelFuncPattern = regexp.MustCompile(`label_values\((.+),\s*(.+)\)`) + +func getLabelFromVariable(variable grafanaspec.VariableModel) (string, error) { + if variable.Query == nil { + return "", fmt.Errorf("query %s is empty", variable.Name) + } + m, ok := (*variable.Query).(map[string]any) + if !ok { + return "", fmt.Errorf("failed to decode query %s map", variable.Name) + } + queryString, ok := m["query"].(string) + if !ok { + return "", fmt.Errorf("failed to get query string from variable: %s", variable.Name) + } + match := labelFuncPattern.FindStringSubmatch(queryString) + if len(match) != 3 { + return "", fmt.Errorf("failed to get label from variable: %s", variable.Name) + } + return match[2], nil +} diff --git a/internal/cmd/iac/import/grafana/parser.go b/internal/cmd/iac/import/grafana/parser.go new file mode 100644 index 0000000..e8bff9d --- /dev/null +++ b/internal/cmd/iac/import/grafana/parser.go @@ -0,0 +1,17 @@ +package grafana + +import ( + "encoding/json" + "fmt" + + "github.com/GuanceCloud/guance-cli/internal/cmd/iac/import/grafana/spec" +) + +// ParseGrafana will parse grafana dashboard json bytes as a json model struct +func ParseGrafana(content []byte) (*spec.Spec, error) { + dashboard := spec.Spec{} + if err := json.Unmarshal(content, &dashboard); err != nil { + return nil, fmt.Errorf("parsing grafana dashboard, unmarshal json error: %w", err) + } + return &dashboard, nil +} diff --git a/internal/cmd/iac/import/grafana/parser_test.go b/internal/cmd/iac/import/grafana/parser_test.go new file mode 100644 index 0000000..aa9beb7 --- /dev/null +++ b/internal/cmd/iac/import/grafana/parser_test.go @@ -0,0 +1,34 @@ +package grafana + +import ( + _ "embed" + "os" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestParse(t *testing.T) { + for _, tt := range []struct { + name string + path string + wantErr bool + }{ + { + name: "example", + path: "testdata/example.json", + }, + } { + t.Run(tt.name, func(t *testing.T) { + want, err := os.ReadFile(tt.path) + if !assert.NoError(t, err) { + t.FailNow() + } + + _, err = ParseGrafana(want) + if !assert.NoError(t, err) { + t.FailNow() + } + }) + } +} diff --git a/internal/cmd/iac/import/grafana/spec/README.md b/internal/cmd/iac/import/grafana/spec/README.md new file mode 100644 index 0000000..f366904 --- /dev/null +++ b/internal/cmd/iac/import/grafana/spec/README.md @@ -0,0 +1,5 @@ +# Grafana Dashboard Specification + +The go code is copied from [grafana/grafana](https://github.com/grafana/grafana/blob/main/pkg/kinds/dashboard/dashboard_spec_gen.go) under GNU Affero General Public License v3.0. + +See [CUE spcification file](./spec.cue) for more details. diff --git a/internal/cmd/iac/import/grafana/spec/hack.go b/internal/cmd/iac/import/grafana/spec/hack.go new file mode 100644 index 0000000..b57473a --- /dev/null +++ b/internal/cmd/iac/import/grafana/spec/hack.go @@ -0,0 +1,16 @@ +package spec + +import ( + "encoding/json" + + "github.com/tidwall/gjson" +) + +func (ref *DataSourceRef) UnmarshalJSON(data []byte) error { + if gjson.GetBytes(data, ".").IsObject() { + return json.Unmarshal(data, ref) + } + typeName := "template" + ref.Type = &typeName + return nil +} diff --git a/internal/cmd/iac/import/grafana/spec/spec.cue b/internal/cmd/iac/import/grafana/spec/spec.cue new file mode 100644 index 0000000..bc2b745 --- /dev/null +++ b/internal/cmd/iac/import/grafana/spec/spec.cue @@ -0,0 +1,611 @@ +// Code is generated. DO NOT EDIT. +// Copied under GNU Affero General Public License v3.0 + +package grafana + +import ( + "strings" + t "time" +) + +name: "Dashboard" +maturity: "experimental" +description: "A Grafana dashboard." + +crd: dummySchema: true + +lineage: schemas: [{ + version: [0, 0] + schema: { + spec: { + // Unique numeric identifier for the dashboard. + // TODO must isolate or remove identifiers local to a Grafana instance...? + id?: int64 + // Unique dashboard identifier that can be generated by anyone. string (8-40) + uid?: string + // Title of dashboard. + title?: string + // Description of dashboard. + description?: string + // This property should only be used in dashboards defined by plugins. It is a quick check + // to see if the version has changed since the last time. Unclear why using the version property + // is insufficient. + revision?: int64 @grafanamaturity(NeedsExpertReview) + // ID of a dashboard imported from the https://grafana.com/grafana/dashboards/ portal + gnetId?: string @grafanamaturity(NeedsExpertReview) + // Tags associated with dashboard. + tags?: [...string] @grafanamaturity(NeedsExpertReview) + // Theme of dashboard. + style: "light" | *"dark" @grafanamaturity(NeedsExpertReview) + // Timezone of dashboard. Accepted values are IANA TZDB zone ID or "browser" or "utc". + timezone?: string | *"browser" + // Whether a dashboard is editable or not. + editable: bool | *true + // Configuration of dashboard cursor sync behavior. + // Accepted values are 0 (sync turned off), 1 (shared crosshair), 2 (shared crosshair and tooltip). + graphTooltip: #DashboardCursorSync + // Time range for dashboard. + // Accepted values are relative time strings like {from: 'now-6h', to: 'now'} or absolute time strings like {from: '2020-07-10T08:00:00.000Z', to: '2020-07-10T14:00:00.000Z'}. + time?: { + from: string | *"now-6h" + to: string | *"now" + } @grafanamaturity(NeedsExpertReview) + + // Configuration of the time picker shown at the top of a dashboard. + timepicker?: { + // Whether timepicker is visible or not. + hidden: bool | *false + // Interval options available in the refresh picker dropdown. + refresh_intervals: [...string] | *["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"] + // Whether timepicker is collapsed or not. Has no effect on provisioned dashboard. + collapse: bool | *false + // Whether timepicker is enabled or not. Has no effect on provisioned dashboard. + enable: bool | *true + // Selectable options available in the time picker dropdown. Has no effect on provisioned dashboard. + time_options: [...string] | *["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"] + } @grafanamaturity(NeedsExpertReview) + // The month that the fiscal year starts on. 0 = January, 11 = December + fiscalYearStartMonth?: uint8 & <12 | *0 + // When set to true, the dashboard will redraw panels at an interval matching the pixel width. + // This will keep data "moving left" regardless of the query refresh rate. This setting helps + // avoid dashboards presenting stale live data + liveNow?: bool @grafanamaturity(NeedsExpertReview) + // Day when the week starts. Expressed by the name of the day in lowercase, e.g. "monday". + weekStart?: string + + // Refresh rate of dashboard. Represented via interval string, e.g. "5s", "1m", "1h", "1d". + refresh?: string | false + // Version of the JSON schema, incremented each time a Grafana update brings + // changes to said schema. + // TODO this is the existing schema numbering system. It will be replaced by Thema's themaVersion + schemaVersion: uint16 | *36 + // Version of the dashboard, incremented each time the dashboard is updated. + version?: uint32 @grafanamaturity(NeedsExpertReview) + panels?: [...(#Panel | #RowPanel | #GraphPanel | #HeatmapPanel)] @grafanamaturity(NeedsExpertReview) + // Contains the list of configured template variables with their saved values along with some other metadata + templating?: { + list?: [...#VariableModel] @grafanamaturity(NeedsExpertReview) + } + + // TODO docs + annotations?: #AnnotationContainer + + // Links with references to other dashboards or external websites. + links?: [...#DashboardLink] @grafanamaturity(NeedsExpertReview) + + snapshot?: #Snapshot @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") @grafana(TSVeneer="type") + + /////////////////////////////////////// + // Definitions (referenced above) are declared below + + // TODO: this should be a regular DataQuery that depends on the selected dashboard + // these match the properties of the "grafana" datasouce that is default in most dashboards + #AnnotationTarget: { + // Only required/valid for the grafana datasource... + // but code+tests is already depending on it so hard to change + limit: int64 + // Only required/valid for the grafana datasource... + // but code+tests is already depending on it so hard to change + matchAny: bool + // Only required/valid for the grafana datasource... + // but code+tests is already depending on it so hard to change + tags: [...string] + // Only required/valid for the grafana datasource... + // but code+tests is already depending on it so hard to change + type: string + ... // datasource will stick their raw DataQuery here + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + #AnnotationPanelFilter: { + // Should the specified panels be included or excluded + exclude?: bool | *false + + // Panel IDs that should be included or excluded + ids: [...uint8] + } @cuetsy(kind="interface") + + // TODO -- should not be a public interface on its own, but required for Veneer + #AnnotationContainer: { + // annoying... but required so that the list is defined using the nested Veneer + @grafana(TSVeneer="type") + + list?: [...#AnnotationQuery] @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") + + // TODO docs + // FROM: AnnotationQuery in grafana-data/src/types/annotations.ts + #AnnotationQuery: { + @grafana(TSVeneer="type") + + // Name of annotation. + name: string + + // Datasource where the annotations data is + datasource: #DataSourceRef + + // When enabled the annotation query is issued with every dashboard refresh + enable: bool | *true + + // Annotation queries can be toggled on or off at the top of the dashboard. + // When hide is true, the toggle is not shown in the dashboard. + hide?: bool | *false + + // Color to use for the annotation event markers + iconColor: string + + // Filters to apply when fetching annotations + filter?: #AnnotationPanelFilter + + // TODO.. this should just be a normal query target + target?: #AnnotationTarget + + // TODO -- this should not exist here, it is based on the --grafana-- datasource + type?: string @grafanamaturity(NeedsExpertReview) + + // unless datasources have migrated to the target+mapping, + // they just spread their query into the base object :( + ... + } @cuetsy(kind="interface") + + #LoadingState: "NotStarted" | "Loading" | "Streaming" | "Done" | "Error" @cuetsy(kind="enum") @grafanamaturity(NeedsExpertReview) + + // FROM: packages/grafana-data/src/types/templateVars.ts + // TODO docs + // TODO what about what's in public/app/features/types.ts? + // TODO there appear to be a lot of different kinds of [template] vars here? if so need a disjunction + #VariableModel: { + id: string | *"00000000-0000-0000-0000-000000000000" + type: #VariableType + name: string + label?: string + rootStateKey?: string + global: bool | *false + hide: #VariableHide + skipUrlSync: bool | *false + index: int32 | *-1 + state: #LoadingState + error?: {...} + description?: string + // TODO: Move this into a separated QueryVariableModel type + query?: string | {...} + datasource?: #DataSourceRef + ... + } @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview) + #VariableHide: 0 | 1 | 2 @cuetsy(kind="enum",memberNames="dontHide|hideLabel|hideVariable") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview) + #LoadingState: "NotStarted" | "Loading" | "Streaming" | "Done" | "Error" @cuetsy(kind="enum") @grafanamaturity(NeedsExpertReview) + + // Ref to a DataSource instance + #DataSourceRef: { + // The plugin type-id + type?: string @grafanamaturity(NeedsExpertReview) + + // Specific datasource instance + uid?: string @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview) + + // Links with references to other dashboards or external resources + #DashboardLink: { + // Title to display with the link + title: string @grafanamaturity(NeedsExpertReview) + // Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource) + type: #DashboardLinkType @grafanamaturity(NeedsExpertReview) + // Icon name to be displayed with the link + icon: string @grafanamaturity(NeedsExpertReview) + // Tooltip to display when the user hovers their mouse over it + tooltip: string @grafanamaturity(NeedsExpertReview) + // Link URL. Only required/valid if the type is link + url: string @grafanamaturity(NeedsExpertReview) + // List of tags to limit the linked dashboards. If empty, all dashboards will be displayed. Only valid if the type is dashboards + tags: [...string] @grafanamaturity(NeedsExpertReview) + // If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards + asDropdown: bool | *false @grafanamaturity(NeedsExpertReview) + // If true, the link will be opened in a new tab + targetBlank: bool | *false @grafanamaturity(NeedsExpertReview) + // If true, includes current template variables values in the link as query params + includeVars: bool | *false @grafanamaturity(NeedsExpertReview) + // If true, includes current time range in the link as query params + keepTime: bool | *false @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") + + // Dashboard Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource) + #DashboardLinkType: "link" | "dashboards" @cuetsy(kind="type") @grafanamaturity(NeedsExpertReview) + + // FROM: packages/grafana-data/src/types/templateVars.ts + // TODO docs + // TODO this implies some wider pattern/discriminated union, probably? + #VariableType: "query" | "adhoc" | "constant" | "datasource" | "interval" | "textbox" | "custom" | "system" @cuetsy(kind="type") @grafanamaturity(NeedsExpertReview) + + // TODO docs + #FieldColorModeId: "thresholds" | "palette-classic" | "palette-saturated" | "continuous-GrYlRd" | "fixed" @cuetsy(kind="enum",memberNames="Thresholds|PaletteClassic|PaletteSaturated|ContinuousGrYlRd|Fixed") @grafanamaturity(NeedsExpertReview) + + // TODO docs + #FieldColorSeriesByMode: "min" | "max" | "last" @cuetsy(kind="type") @grafanamaturity(NeedsExpertReview) + + // TODO docs + #FieldColor: { + // The main color scheme mode + mode: #FieldColorModeId | string + // Stores the fixed color value if mode is fixed + fixedColor?: string + // Some visualizations need to know how to assign a series color from by value color schemes + seriesBy?: #FieldColorSeriesByMode + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + #GridPos: { + // Panel + h: uint32 & >0 | *9 @grafanamaturity(NeedsExpertReview) + // Panel + w: uint32 & >0 & <=24 | *12 @grafanamaturity(NeedsExpertReview) + // Panel x + x: uint32 & >=0 & <24 | *0 @grafanamaturity(NeedsExpertReview) + // Panel y + y: uint32 & >=0 | *0 @grafanamaturity(NeedsExpertReview) + // Whether the panel is fixed within the grid + static?: bool @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") + + // User-defined value for a metric that triggers visual changes in a panel when this value is met or exceeded + // They are used to conditionally style and color visualizations based on query results , and can be applied to most visualizations. + #Threshold: { + // Value represents a specified metric for the threshold, which triggers a visual change in the dashboard when this value is met or exceeded. + // FIXME the corresponding typescript field is required/non-optional, but nulls currently appear here when serializing -Infinity to JSON + value?: number @grafanamaturity(NeedsExpertReview) + // Color represents the color of the visual change that will occur in the dashboard when the threshold value is met or exceeded. + color: string @grafanamaturity(NeedsExpertReview) + // Threshold index, an old property that is not needed an should only appear in older dashboards + index?: int32 @grafanamaturity(NeedsExpertReview) + // TODO docs + // TODO are the values here enumerable into a disjunction? + // Some seem to be listed in typescript comment + state?: string @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + // Thresholds can either be absolute (specific number) or percentage (relative to min or max). + #ThresholdsMode: "absolute" | "percentage" @cuetsy(kind="enum") @grafanamaturity(NeedsExpertReview) + + #ThresholdsConfig: { + mode: #ThresholdsMode @grafanamaturity(NeedsExpertReview) + + // Must be sorted by 'value', first value is always -Infinity + steps: [...#Threshold] @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + // Allow to transform the visual representation of specific data values in a visualization, irrespective of their original units + #ValueMapping: #ValueMap | #RangeMap | #RegexMap | #SpecialValueMap @cuetsy(kind="type") @grafanamaturity(NeedsExpertReview) + + // Supported value mapping types + #MappingType: "value" | "range" | "regex" | "special" @cuetsy(kind="enum",memberNames="ValueToText|RangeToText|RegexToText|SpecialValue") @grafanamaturity(NeedsExpertReview) + + // Maps text values to a color or different display text + #ValueMap: { + type: #MappingType & "value" + options: [string]: #ValueMappingResult + } @cuetsy(kind="interface") + + // Maps numeric ranges to a color or different display text + #RangeMap: { + type: #MappingType & "range" + options: { + // to and from are `number | null` in current ts, really not sure what to do + from: float64 @grafanamaturity(NeedsExpertReview) + to: float64 @grafanamaturity(NeedsExpertReview) + result: #ValueMappingResult + } + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + // Maps regular expressions to replacement text and a color + #RegexMap: { + type: #MappingType & "regex" + options: { + pattern: string + result: #ValueMappingResult + } + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + // Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text + // and color + #SpecialValueMap: { + type: #MappingType & "special" + options: { + match: "true" | "false" + pattern: string + result: #ValueMappingResult + } + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + // Special value types supported by the SpecialValueMap + #SpecialValueMatch: "true" | "false" | "null" | "nan" | "null+nan" | "empty" @cuetsy(kind="enum",memberNames="True|False|Null|NaN|NullAndNan|Empty") + + // Result used as replacement text and color for RegexMap and SpecialValueMap + #ValueMappingResult: { + text?: string + color?: string + icon?: string + index?: int32 + } @cuetsy(kind="interface") + + // TODO docs + #DataTransformerConfig: { + @grafana(TSVeneer="type") + + // Unique identifier of transformer + id: string + // Disabled transformations are skipped + disabled?: bool + // Optional frame matcher. When missing it will be applied to all results + filter?: #MatcherConfig + // Options to be passed to the transformer + // Valid options depend on the transformer id + options: _ + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + // 0 for no shared crosshair or tooltip (default). + // 1 for shared crosshair. + // 2 for shared crosshair AND shared tooltip. + #DashboardCursorSync: *0 | 1 | 2 @cuetsy(kind="enum",memberNames="Off|Crosshair|Tooltip") + + // Schema for panel targets is specified by datasource + // plugins. We use a placeholder definition, which the Go + // schema loader either left open/as-is with the Base + // variant of the Dashboard and Panel families, or filled + // with types derived from plugins in the Instance variant. + // When working directly from CUE, importers can extend this + // type directly to achieve the same effect. + #Target: {...} @grafanamaturity(NeedsExpertReview) + + // A dashboard snapshot shares an interactive dashboard publicly. + // It is a read-only version of a dashboard, and is not editable. + // It is possible to create a snapshot of a snapshot. + // Grafana strips away all sensitive information from the dashboard. + // Sensitive information stripped: queries (metric, template,annotation) and panel links. + #Snapshot: { + // Time when the snapshot was created + created: string & t.Time + // Time when the snapshot expires, default is never to expire + expires: string @grafanamaturity(NeedsExpertReview) + // Is the snapshot saved in an external grafana instance + external: bool @grafanamaturity(NeedsExpertReview) + // external url, if snapshot was shared in external grafana instance + externalUrl: string @grafanamaturity(NeedsExpertReview) + // Unique identifier of the snapshot + id: uint32 @grafanamaturity(NeedsExpertReview) + // Optional, defined the unique key of the snapshot, required if external is true + key: string @grafanamaturity(NeedsExpertReview) + // Optional, name of the snapshot + name: string @grafanamaturity(NeedsExpertReview) + // org id of the snapshot + orgId: uint32 @grafanamaturity(NeedsExpertReview) + // last time when the snapshot was updated + updated: string & t.Time + // url of the snapshot, if snapshot was shared internally + url?: string @grafanamaturity(NeedsExpertReview) + // user id of the snapshot creator + userId: uint32 @grafanamaturity(NeedsExpertReview) + } @grafanamaturity(NeedsExpertReview) + + // Dashboard panels. Panels are canonically defined inline + // because they share a version timeline with the dashboard + // schema; they do not evolve independently. + #Panel: { + // The panel plugin type id. May not be empty. + type: string & strings.MinRunes(1) @grafanamaturity(NeedsExpertReview) + + // TODO docs + id?: uint32 @grafanamaturity(NeedsExpertReview) + + // FIXME this almost certainly has to be changed in favor of scuemata versions + pluginVersion?: string @grafanamaturity(NeedsExpertReview) + + // TODO docs + tags?: [...string] @grafanamaturity(NeedsExpertReview) + + // TODO docs + targets?: [...#Target] @grafanamaturity(NeedsExpertReview) + + // Panel title. + title?: string @grafanamaturity(NeedsExpertReview) + // Description. + description?: string @grafanamaturity(NeedsExpertReview) + // Whether to display the panel without a background. + transparent: bool | *false @grafanamaturity(NeedsExpertReview) + // The datasource used in all targets. + datasource?: { + type?: string + uid?: string + } @grafanamaturity(NeedsExpertReview) + // Grid position. + gridPos?: #GridPos + // Panel links. + // TODO fill this out - seems there are a couple variants? + links?: [...#DashboardLink] @grafanamaturity(NeedsExpertReview) + + // Name of template variable to repeat for. + repeat?: string @grafanamaturity(NeedsExpertReview) + // Direction to repeat in if 'repeat' is set. + // "h" for horizontal, "v" for vertical. + // TODO this is probably optional + repeatDirection: *"h" | "v" @grafanamaturity(NeedsExpertReview) + // Id of the repeating panel. + repeatPanelId?: int64 @grafanamaturity(NeedsExpertReview) + + // The maximum number of data points that the panel queries are retrieving. + maxDataPoints?: number + + // TODO docs - seems to be an old field from old dashboard alerts? + thresholds?: [...] @grafanamaturity(NeedsExpertReview) + + // TODO docs + timeRegions?: [...] @grafanamaturity(NeedsExpertReview) + + transformations: [...#DataTransformerConfig] @grafanamaturity(NeedsExpertReview) + + // The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables. + // This value must be formatted as a number followed by a valid time + // identifier like: "40s", "3d", etc. + // See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options + interval?: string + + // Overrides the relative time range for individual panels, + // which causes them to be different than what is selected in + // the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different + // time periods or days on the same dashboard. + // The value is formatted as time operation like: `now-5m` (Last 5 minutes), `now/d` (the day so far), + // `now-5d/d`(Last 5 days), `now/w` (This week so far), `now-2y/y` (Last 2 years). + // Note: Panel time overrides have no effect when the dashboard’s time range is absolute. + // See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options + timeFrom?: string + + // Overrides the time range for individual panels by shifting its start and end relative to the time picker. + // For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting `2h`. + // Note: Panel time overrides have no effect when the dashboard’s time range is absolute. + // See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options + timeShift?: string + + // Dynamically load the panel + libraryPanel?: #LibraryPanelRef + + // options is specified by the Options field in panel + // plugin schemas. + options: {...} @grafanamaturity(NeedsExpertReview) + + fieldConfig: #FieldConfigSource + } @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview) + + #FieldConfigSource: { + defaults: #FieldConfig + overrides: [...{ + matcher: #MatcherConfig + properties: [...#DynamicConfigValue] + }] @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview) + + #LibraryPanelRef: { + name: string + uid: string + } @cuetsy(kind="interface") + + #MatcherConfig: { + id: string | *"" @grafanamaturity(NeedsExpertReview) + options?: _ @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") @grafana(TSVeneer="type") + + #DynamicConfigValue: { + id: string | *"" @grafanamaturity(NeedsExpertReview) + value?: _ @grafanamaturity(NeedsExpertReview) + } + + #FieldConfig: { + // The display value for this field. This supports template variables blank is auto + displayName?: string @grafanamaturity(NeedsExpertReview) + + // This can be used by data sources that return and explicit naming structure for values and labels + // When this property is configured, this value is used rather than the default naming strategy. + displayNameFromDS?: string @grafanamaturity(NeedsExpertReview) + + // Human readable field metadata + description?: string @grafanamaturity(NeedsExpertReview) + + // An explicit path to the field in the datasource. When the frame meta includes a path, + // This will default to `${frame.meta.path}/${field.name} + // + // When defined, this value can be used as an identifier within the datasource scope, and + // may be used to update the results + path?: string @grafanamaturity(NeedsExpertReview) + + // True if data source can write a value to the path. Auth/authz are supported separately + writeable?: bool @grafanamaturity(NeedsExpertReview) + + // True if data source field supports ad-hoc filters + filterable?: bool @grafanamaturity(NeedsExpertReview) + + // Numeric Options + unit?: string @grafanamaturity(NeedsExpertReview) + + // Significant digits (for display) + decimals?: number @grafanamaturity(NeedsExpertReview) + + min?: number @grafanamaturity(NeedsExpertReview) + max?: number @grafanamaturity(NeedsExpertReview) + + // Convert input values into a display string + mappings?: [...#ValueMapping] @grafanamaturity(NeedsExpertReview) + + // Map numeric values to states + thresholds?: #ThresholdsConfig @grafanamaturity(NeedsExpertReview) + + // Map values to a display color + color?: #FieldColor @grafanamaturity(NeedsExpertReview) + + // Used when reducing field values + // nullValueMode?: NullValueMode + + // The behavior when clicking on a result + links?: [...] @grafanamaturity(NeedsExpertReview) + + // Alternative to empty string + noValue?: string @grafanamaturity(NeedsExpertReview) + + // custom is specified by the FieldConfig field + // in panel plugin schemas. + custom?: {...} @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") @grafana(TSVeneer="type") @grafanamaturity(NeedsExpertReview) + + // Row panel + #RowPanel: { + type: "row" @grafanamaturity(NeedsExpertReview) + collapsed: bool | *false @grafanamaturity(NeedsExpertReview) + title?: string @grafanamaturity(NeedsExpertReview) + + // Name of default datasource. + datasource?: { + type?: string @grafanamaturity(NeedsExpertReview) + uid?: string @grafanamaturity(NeedsExpertReview) + } @grafanamaturity(NeedsExpertReview) + + gridPos?: #GridPos + id: uint32 @grafanamaturity(NeedsExpertReview) + panels: [...(#Panel | #GraphPanel | #HeatmapPanel)] @grafanamaturity(NeedsExpertReview) + // Name of template variable to repeat for. + repeat?: string @grafanamaturity(NeedsExpertReview) + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + // Support for legacy graph and heatmap panels. + #GraphPanel: { + type: "graph" @grafanamaturity(NeedsExpertReview) + // @deprecated this is part of deprecated graph panel + legend?: { + show: bool | *true + sort?: string + sortDesc?: bool + } + ... + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + + #HeatmapPanel: { + type: "heatmap" @grafanamaturity(NeedsExpertReview) + ... + } @cuetsy(kind="interface") @grafanamaturity(NeedsExpertReview) + } +}, +] diff --git a/internal/cmd/iac/import/grafana/spec/spec.go b/internal/cmd/iac/import/grafana/spec/spec.go new file mode 100644 index 0000000..2f1a90e --- /dev/null +++ b/internal/cmd/iac/import/grafana/spec/spec.go @@ -0,0 +1,814 @@ +// Code generated - EDITING IS FUTILE. DO NOT EDIT. +// +// Generated by: +// kinds/gen.go +// Using jennies: +// GoResourceTypes +// +// Run 'make gen-cue' from repository root to regenerate. + +package spec + +import ( + "time" +) + +// Defines values for CursorSync. +const ( + CursorSyncN0 CursorSync = 0 + CursorSyncN1 CursorSync = 1 + CursorSyncN2 CursorSync = 2 +) + +// Defines values for LinkType. +const ( + LinkTypeDashboards LinkType = "dashboards" + LinkTypeLink LinkType = "link" +) + +// Defines values for FieldColorSeriesByMode. +const ( + FieldColorSeriesByModeLast FieldColorSeriesByMode = "last" + FieldColorSeriesByModeMax FieldColorSeriesByMode = "max" + FieldColorSeriesByModeMin FieldColorSeriesByMode = "min" +) + +// Defines values for GraphPanelType. +const ( + GraphPanelTypeGraph GraphPanelType = "graph" +) + +// Defines values for HeatmapPanelType. +const ( + HeatmapPanelTypeHeatmap HeatmapPanelType = "heatmap" +) + +// Defines values for LoadingState. +const ( + LoadingStateDone LoadingState = "Done" + LoadingStateError LoadingState = "Error" + LoadingStateLoading LoadingState = "Loading" + LoadingStateNotStarted LoadingState = "NotStarted" + LoadingStateStreaming LoadingState = "Streaming" +) + +// Defines values for MappingType. +const ( + MappingTypeRange MappingType = "range" + MappingTypeRegex MappingType = "regex" + MappingTypeSpecial MappingType = "special" + MappingTypeValue MappingType = "value" +) + +// Defines values for PanelRepeatDirection. +const ( + PanelRepeatDirectionH PanelRepeatDirection = "h" + PanelRepeatDirectionV PanelRepeatDirection = "v" +) + +// Defines values for RangeMapType. +const ( + RangeMapTypeRange RangeMapType = "range" + RangeMapTypeRegex RangeMapType = "regex" + RangeMapTypeSpecial RangeMapType = "special" + RangeMapTypeValue RangeMapType = "value" +) + +// Defines values for RegexMapType. +const ( + RegexMapTypeRange RegexMapType = "range" + RegexMapTypeRegex RegexMapType = "regex" + RegexMapTypeSpecial RegexMapType = "special" + RegexMapTypeValue RegexMapType = "value" +) + +// Defines values for RowPanelType. +const ( + RowPanelTypeRow RowPanelType = "row" +) + +// Defines values for SpecStyle. +const ( + SpecStyleDark SpecStyle = "dark" + SpecStyleLight SpecStyle = "light" +) + +// Defines values for SpecialValueMapOptionsMatch. +const ( + SpecialValueMapOptionsMatchFalse SpecialValueMapOptionsMatch = "false" + SpecialValueMapOptionsMatchTrue SpecialValueMapOptionsMatch = "true" +) + +// Defines values for SpecialValueMapType. +const ( + SpecialValueMapTypeRange SpecialValueMapType = "range" + SpecialValueMapTypeRegex SpecialValueMapType = "regex" + SpecialValueMapTypeSpecial SpecialValueMapType = "special" + SpecialValueMapTypeValue SpecialValueMapType = "value" +) + +// Defines values for ThresholdsMode. +const ( + ThresholdsModeAbsolute ThresholdsMode = "absolute" + ThresholdsModePercentage ThresholdsMode = "percentage" +) + +// Defines values for ValueMapType. +const ( + ValueMapTypeRange ValueMapType = "range" + ValueMapTypeRegex ValueMapType = "regex" + ValueMapTypeSpecial ValueMapType = "special" + ValueMapTypeValue ValueMapType = "value" +) + +// Defines values for VariableHide. +const ( + VariableHideN0 VariableHide = 0 + VariableHideN1 VariableHide = 1 + VariableHideN2 VariableHide = 2 +) + +// Defines values for VariableType. +const ( + VariableTypeAdhoc VariableType = "adhoc" + VariableTypeConstant VariableType = "constant" + VariableTypeCustom VariableType = "custom" + VariableTypeDatasource VariableType = "datasource" + VariableTypeInterval VariableType = "interval" + VariableTypeQuery VariableType = "query" + VariableTypeSystem VariableType = "system" + VariableTypeTextbox VariableType = "textbox" +) + +// TODO -- should not be a public interface on its own, but required for Veneer +type AnnotationContainer struct { + List []AnnotationQuery `json:"list,omitempty"` +} + +// AnnotationPanelFilter defines model for AnnotationPanelFilter. +type AnnotationPanelFilter struct { + // Should the specified panels be included or excluded + Exclude *bool `json:"exclude,omitempty"` + + // Panel IDs that should be included or excluded + Ids []int `json:"ids"` +} + +// TODO docs +// FROM: AnnotationQuery in grafana-data/src/types/annotations.ts +type AnnotationQuery struct { + // Ref to a DataSource instance + Datasource DataSourceRef `json:"datasource"` + + // When enabled the annotation query is issued with every dashboard refresh + Enable bool `json:"enable"` + Filter *AnnotationPanelFilter `json:"filter,omitempty"` + + // Annotation queries can be toggled on or off at the top of the dashboard. + // When hide is true, the toggle is not shown in the dashboard. + Hide *bool `json:"hide,omitempty"` + + // Color to use for the annotation event markers + IconColor string `json:"iconColor"` + + // Name of annotation. + Name string `json:"name"` + + // TODO: this should be a regular DataQuery that depends on the selected dashboard + // these match the properties of the "grafana" datasouce that is default in most dashboards + Target *AnnotationTarget `json:"target,omitempty"` + + // TODO -- this should not exist here, it is based on the --grafana-- datasource + Type *string `json:"type,omitempty"` +} + +// TODO: this should be a regular DataQuery that depends on the selected dashboard +// these match the properties of the "grafana" datasouce that is default in most dashboards +type AnnotationTarget struct { + // Only required/valid for the grafana datasource... + // but code+tests is already depending on it so hard to change + Limit int64 `json:"limit"` + + // Only required/valid for the grafana datasource... + // but code+tests is already depending on it so hard to change + MatchAny bool `json:"matchAny"` + + // Only required/valid for the grafana datasource... + // but code+tests is already depending on it so hard to change + Tags []string `json:"tags"` + + // Only required/valid for the grafana datasource... + // but code+tests is already depending on it so hard to change + Type string `json:"type"` +} + +// 0 for no shared crosshair or tooltip (default). +// 1 for shared crosshair. +// 2 for shared crosshair AND shared tooltip. +type CursorSync int + +// Links with references to other dashboards or external resources +type Link struct { + // If true, all dashboards links will be displayed in a dropdown. If false, all dashboards links will be displayed side by side. Only valid if the type is dashboards + AsDropdown bool `json:"asDropdown"` + + // Icon name to be displayed with the link + Icon string `json:"icon"` + + // If true, includes current template variables values in the link as query params + IncludeVars bool `json:"includeVars"` + + // If true, includes current time range in the link as query params + KeepTime bool `json:"keepTime"` + + // List of tags to limit the linked dashboards. If empty, all dashboards will be displayed. Only valid if the type is dashboards + Tags []string `json:"tags"` + + // If true, the link will be opened in a new tab + TargetBlank bool `json:"targetBlank"` + + // Title to display with the link + Title string `json:"title"` + + // Tooltip to display when the user hovers their mouse over it + Tooltip string `json:"tooltip"` + + // Dashboard Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource) + Type LinkType `json:"type"` + + // Link URL. Only required/valid if the type is link + Url string `json:"url"` +} + +// Dashboard Link type. Accepted values are dashboards (to refer to another dashboard) and link (to refer to an external resource) +type LinkType string + +// Ref to a DataSource instance +type DataSourceRef struct { + // The plugin type-id + Type *string `json:"type,omitempty"` + + // Specific datasource instance + Uid *string `json:"uid,omitempty"` +} + +// TODO docs +type DataTransformerConfig struct { + // Disabled transformations are skipped + Disabled *bool `json:"disabled,omitempty"` + Filter *MatcherConfig `json:"filter,omitempty"` + + // Unique identifier of transformer + Id string `json:"id"` + + // Options to be passed to the transformer + // Valid options depend on the transformer id + Options any `json:"options"` +} + +// DynamicConfigValue defines model for DynamicConfigValue. +type DynamicConfigValue struct { + Id string `json:"id"` + Value *any `json:"value,omitempty"` +} + +// TODO docs +type FieldColor struct { + // Stores the fixed color value if mode is fixed + FixedColor *string `json:"fixedColor,omitempty"` + + // The main color scheme mode + Mode string `json:"mode"` + + // TODO docs + SeriesBy *FieldColorSeriesByMode `json:"seriesBy,omitempty"` +} + +// TODO docs +type FieldColorSeriesByMode string + +// FieldConfig defines model for FieldConfig. +type FieldConfig struct { + // TODO docs + Color *FieldColor `json:"color,omitempty"` + + // custom is specified by the FieldConfig field + // in panel plugin schemas. + Custom map[string]any `json:"custom,omitempty"` + + // Significant digits (for display) + Decimals *float32 `json:"decimals,omitempty"` + + // Human readable field metadata + Description *string `json:"description,omitempty"` + + // The display value for this field. This supports template variables blank is auto + DisplayName *string `json:"displayName,omitempty"` + + // This can be used by data sources that return and explicit naming structure for values and labels + // When this property is configured, this value is used rather than the default naming strategy. + DisplayNameFromDS *string `json:"displayNameFromDS,omitempty"` + + // True if data source field supports ad-hoc filters + Filterable *bool `json:"filterable,omitempty"` + + // The behavior when clicking on a result + Links []any `json:"links,omitempty"` + + // Convert input values into a display string + Mappings []any `json:"mappings,omitempty"` + Max *float32 `json:"max,omitempty"` + Min *float32 `json:"min,omitempty"` + + // Alternative to empty string + NoValue *string `json:"noValue,omitempty"` + + // An explicit path to the field in the datasource. When the frame meta includes a path, + // This will default to `${frame.meta.path}/${field.name} + // + // When defined, this value can be used as an identifier within the datasource scope, and + // may be used to update the results + Path *string `json:"path,omitempty"` + Thresholds *ThresholdsConfig `json:"thresholds,omitempty"` + + // Numeric Options + Unit *string `json:"unit,omitempty"` + + // True if data source can write a value to the path. Auth/authz are supported separately + Writeable *bool `json:"writeable,omitempty"` +} + +// FieldConfigSource defines model for FieldConfigSource. +type FieldConfigSource struct { + Defaults FieldConfig `json:"defaults"` + Overrides []struct { + Matcher MatcherConfig `json:"matcher"` + Properties []DynamicConfigValue `json:"properties"` + } `json:"overrides"` +} + +// Support for legacy graph and heatmap panels. +type GraphPanel struct { + // @deprecated this is part of deprecated graph panel + Legend *struct { + Show bool `json:"show"` + Sort *string `json:"sort,omitempty"` + SortDesc *bool `json:"sortDesc,omitempty"` + } `json:"legend,omitempty"` + Type GraphPanelType `json:"type"` +} + +// GraphPanelType defines model for GraphPanel.Type. +type GraphPanelType string + +// GridPos defines model for GridPos. +type GridPos struct { + // H Panel + H int `json:"h"` + + // Whether the panel is fixed within the grid + Static *bool `json:"static,omitempty"` + + // W Panel + W int `json:"w"` + + // Panel x + X int `json:"x"` + + // Panel y + Y int `json:"y"` +} + +// HeatmapPanel defines model for HeatmapPanel. +type HeatmapPanel struct { + Type HeatmapPanelType `json:"type"` +} + +// HeatmapPanelType defines model for HeatmapPanel.Type. +type HeatmapPanelType string + +// LibraryPanelRef defines model for LibraryPanelRef. +type LibraryPanelRef struct { + Name string `json:"name"` + Uid string `json:"uid"` +} + +// LoadingState defines model for LoadingState. +type LoadingState string + +// Supported value mapping types +type MappingType string + +// MatcherConfig defines model for MatcherConfig. +type MatcherConfig struct { + Id string `json:"id"` + Options *any `json:"options,omitempty"` +} + +// Dashboard panels. Panels are canonically defined inline +// because they share a version timeline with the dashboard +// schema; they do not evolve independently. +type Panel struct { + // The datasource used in all targets. + Datasource *struct { + Type *string `json:"type,omitempty"` + Uid *string `json:"uid,omitempty"` + } `json:"datasource,omitempty"` + + // Description Description. + Description *string `json:"description,omitempty"` + FieldConfig FieldConfigSource `json:"fieldConfig"` + GridPos *GridPos `json:"gridPos,omitempty"` + + // TODO docs + Id *int `json:"id,omitempty"` + + // The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables. + // This value must be formatted as a number followed by a valid time + // identifier like: "40s", "3d", etc. + // See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options + Interval *string `json:"interval,omitempty"` + LibraryPanel *LibraryPanelRef `json:"libraryPanel,omitempty"` + + // Panel links. + // TODO fill this out - seems there are a couple variants? + Links []Link `json:"links,omitempty"` + + // The maximum number of data points that the panel queries are retrieving. + MaxDataPoints *float32 `json:"maxDataPoints,omitempty"` + + // options is specified by the Options field in panel + // plugin schemas. + Options map[string]any `json:"options"` + + // FIXME this almost certainly has to be changed in favor of scuemata versions + PluginVersion *string `json:"pluginVersion,omitempty"` + + // Name of template variable to repeat for. + Repeat *string `json:"repeat,omitempty"` + + // Direction to repeat in if 'repeat' is set. + // "h" for horizontal, "v" for vertical. + // TODO this is probably optional + RepeatDirection PanelRepeatDirection `json:"repeatDirection"` + + // Id of the repeating panel. + RepeatPanelId *int64 `json:"repeatPanelId,omitempty"` + + // TODO docs + Tags []string `json:"tags,omitempty"` + + // TODO docs + Targets []Target `json:"targets,omitempty"` + + // TODO docs - seems to be an old field from old dashboard alerts? + Thresholds []any `json:"thresholds,omitempty"` + + // Overrides the relative time range for individual panels, + // which causes them to be different than what is selected in + // the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different + // time periods or days on the same dashboard. + // The value is formatted as time operation like: `now-5m` (Last 5 minutes), `now/d` (the day so far), + // `now-5d/d`(Last 5 days), `now/w` (This week so far), `now-2y/y` (Last 2 years). + // Note: Panel time overrides have no effect when the dashboard’s time range is absolute. + // See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options + TimeFrom *string `json:"timeFrom,omitempty"` + + // TODO docs + TimeRegions []any `json:"timeRegions,omitempty"` + + // Overrides the time range for individual panels by shifting its start and end relative to the time picker. + // For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting `2h`. + // Note: Panel time overrides have no effect when the dashboard’s time range is absolute. + // See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options + TimeShift *string `json:"timeShift,omitempty"` + + // Panel title. + Title *string `json:"title,omitempty"` + Transformations []DataTransformerConfig `json:"transformations"` + + // Whether to display the panel without a background. + Transparent bool `json:"transparent"` + + // The panel plugin type id. May not be empty. + Type string `json:"type"` +} + +// Direction to repeat in if 'repeat' is set. +// "h" for horizontal, "v" for vertical. +// TODO this is probably optional +type PanelRepeatDirection string + +// Maps numeric ranges to a color or different display text +type RangeMap struct { + Options struct { + // From to and from are `number | null` in current ts, really not sure what to do + From float64 `json:"from"` + + // Result used as replacement text and color for RegexMap and SpecialValueMap + Result ValueMappingResult `json:"result"` + To float64 `json:"to"` + } `json:"options"` + Type RangeMapType `json:"type"` +} + +// RangeMapType defines model for RangeMap.Type. +type RangeMapType string + +// Maps regular expressions to replacement text and a color +type RegexMap struct { + Options struct { + Pattern string `json:"pattern"` + + // Result used as replacement text and color for RegexMap and SpecialValueMap + Result ValueMappingResult `json:"result"` + } `json:"options"` + Type RegexMapType `json:"type"` +} + +// RegexMapType defines model for RegexMap.Type. +type RegexMapType string + +// Row panel +type RowPanel struct { + Collapsed bool `json:"collapsed"` + + // Name of default datasource. + Datasource *struct { + Type *string `json:"type,omitempty"` + Uid *string `json:"uid,omitempty"` + } `json:"datasource,omitempty"` + GridPos *GridPos `json:"gridPos,omitempty"` + Id int `json:"id"` + Panels []any `json:"panels"` + + // Name of template variable to repeat for. + Repeat *string `json:"repeat,omitempty"` + Title *string `json:"title,omitempty"` + Type RowPanelType `json:"type"` +} + +// RowPanelType defines model for RowPanel.Type. +type RowPanelType string + +// A dashboard snapshot shares an interactive dashboard publicly. +// It is a read-only version of a dashboard, and is not editable. +// It is possible to create a snapshot of a snapshot. +// Grafana strips away all sensitive information from the dashboard. +// Sensitive information stripped: queries (metric, template,annotation) and panel links. +type Snapshot struct { + // Time when the snapshot was created + Created time.Time `json:"created"` + + // Time when the snapshot expires, default is never to expire + Expires string `json:"expires"` + + // Is the snapshot saved in an external grafana instance + External bool `json:"external"` + + // ExternalUrl external url, if snapshot was shared in external grafana instance + ExternalUrl string `json:"externalUrl"` + + // Unique identifier of the snapshot + Id int `json:"id"` + + // Optional, defined the unique key of the snapshot, required if external is true + Key string `json:"key"` + + // Optional, name of the snapshot + Name string `json:"name"` + + // OrgId org id of the snapshot + OrgId int `json:"orgId"` + + // Updated last time when the snapshot was updated + Updated time.Time `json:"updated"` + + // url of the snapshot, if snapshot was shared internally + Url *string `json:"url,omitempty"` + + // UserId user id of the snapshot creator + UserId int `json:"userId"` +} + +// Spec defines model for Spec. +type Spec struct { + // TODO -- should not be a public interface on its own, but required for Veneer + Annotations *AnnotationContainer `json:"annotations,omitempty"` + + // Description of dashboard. + Description *string `json:"description,omitempty"` + + // Whether a dashboard is editable or not. + Editable bool `json:"editable"` + + // The month that the fiscal year starts on. 0 = January, 11 = December + FiscalYearStartMonth *int `json:"fiscalYearStartMonth,omitempty"` + + // ID of a dashboard imported from the https://grafana.com/grafana/dashboards/ portal + //GnetId *string `json:"gnetId,omitempty"` + + // 0 for no shared crosshair or tooltip (default). + // 1 for shared crosshair. + // 2 for shared crosshair AND shared tooltip. + GraphTooltip CursorSync `json:"graphTooltip"` + + // Unique numeric identifier for the dashboard. + // TODO must isolate or remove identifiers local to a Grafana instance...? + Id *int64 `json:"id,omitempty"` + + // Links with references to other dashboards or external websites. + Links []Link `json:"links,omitempty"` + + // When set to true, the dashboard will redraw panels at an interval matching the pixel width. + // This will keep data "moving left" regardless of the query refresh rate. This setting helps + // avoid dashboards presenting stale live data + LiveNow *bool `json:"liveNow,omitempty"` + Panels []any `json:"panels,omitempty"` + + // Refresh rate of dashboard. Represented via interval string, e.g. "5s", "1m", "1h", "1d". + Refresh *any `json:"refresh,omitempty"` + + // This property should only be used in dashboards defined by plugins. It is a quick check + // to see if the version has changed since the last time. Unclear why using the version property + // is insufficient. + Revision *int64 `json:"revision,omitempty"` + + // Version of the JSON schema, incremented each time a Grafana update brings + // changes to said schema. + // TODO this is the existing schema numbering system. It will be replaced by Thema's themaVersion + SchemaVersion int `json:"schemaVersion"` + + // A dashboard snapshot shares an interactive dashboard publicly. + // It is a read-only version of a dashboard, and is not editable. + // It is possible to create a snapshot of a snapshot. + // Grafana strips away all sensitive information from the dashboard. + // Sensitive information stripped: queries (metric, template,annotation) and panel links. + Snapshot *Snapshot `json:"snapshot,omitempty"` + + // Theme of dashboard. + Style SpecStyle `json:"style"` + + // Tags associated with dashboard. + Tags []string `json:"tags,omitempty"` + + // Contains the list of configured template variables with their saved values along with some other metadata + Templating *struct { + List []VariableModel `json:"list,omitempty"` + } `json:"templating,omitempty"` + + // Time range for dashboard. + // Accepted values are relative time strings like {from: 'now-6h', to: 'now'} or absolute time strings like {from: '2020-07-10T08:00:00.000Z', to: '2020-07-10T14:00:00.000Z'}. + Time *struct { + From string `json:"from"` + To string `json:"to"` + } `json:"time,omitempty"` + + // Configuration of the time picker shown at the top of a dashboard. + Timepicker *struct { + // Whether timepicker is collapsed or not. Has no effect on provisioned dashboard. + Collapse bool `json:"collapse"` + + // Whether timepicker is enabled or not. Has no effect on provisioned dashboard. + Enable bool `json:"enable"` + + // Whether timepicker is visible or not. + Hidden bool `json:"hidden"` + + // Interval options available in the refresh picker dropdown. + RefreshIntervals []string `json:"refresh_intervals"` + + // Selectable options available in the time picker dropdown. Has no effect on provisioned dashboard. + TimeOptions []string `json:"time_options"` + } `json:"timepicker,omitempty"` + + // Timezone of dashboard. Accepted values are IANA TZDB zone ID or "browser" or "utc". + Timezone *string `json:"timezone,omitempty"` + + // Title of dashboard. + Title *string `json:"title,omitempty"` + + // Unique dashboard identifier that can be generated by anyone. string (8-40) + Uid *string `json:"uid,omitempty"` + + // Version of the dashboard, incremented each time the dashboard is updated. + Version *int `json:"version,omitempty"` + + // Day when the week starts. Expressed by the name of the day in lowercase, e.g. "monday". + WeekStart *string `json:"weekStart,omitempty"` +} + +// Theme of dashboard. +type SpecStyle string + +// Maps special values like Null, NaN (not a number), and boolean values like true and false to a display text +// and color +type SpecialValueMap struct { + Options struct { + Match SpecialValueMapOptionsMatch `json:"match"` + Pattern string `json:"pattern"` + + // Result used as replacement text and color for RegexMap and SpecialValueMap + Result ValueMappingResult `json:"result"` + } `json:"options"` + Type SpecialValueMapType `json:"type"` +} + +// SpecialValueMapOptionsMatch defines model for SpecialValueMap.Options.Match. +type SpecialValueMapOptionsMatch string + +// SpecialValueMapType defines model for SpecialValueMap.Type. +type SpecialValueMapType string + +// Schema for panel targets is specified by datasource +// plugins. We use a placeholder definition, which the Go +// schema loader either left open/as-is with the Base +// variant of the Dashboard and Panel families, or filled +// with types derived from plugins in the Instance variant. +// When working directly from CUE, importers can extend this +// type directly to achieve the same effect. +type Target = map[string]any + +// User-defined value for a metric that triggers visual changes in a panel when this value is met or exceeded +// They are used to conditionally style and color visualizations based on query results , and can be applied to most visualizations. +type Threshold struct { + // Color represents the color of the visual change that will occur in the dashboard when the threshold value is met or exceeded. + Color string `json:"color"` + + // Threshold index, an old property that is not needed an should only appear in older dashboards + Index *int32 `json:"index,omitempty"` + + // TODO docs + // TODO are the values here enumerable into a disjunction? + // Some seem to be listed in typescript comment + State *string `json:"state,omitempty"` + + // Value represents a specified metric for the threshold, which triggers a visual change in the dashboard when this value is met or exceeded. + // FIXME the corresponding typescript field is required/non-optional, but nulls currently appear here when serializing -Infinity to JSON + Value *float32 `json:"value,omitempty"` +} + +// ThresholdsConfig defines model for ThresholdsConfig. +type ThresholdsConfig struct { + // Thresholds can either be absolute (specific number) or percentage (relative to min or max). + Mode ThresholdsMode `json:"mode"` + + // Must be sorted by 'value', first value is always -Infinity + Steps []Threshold `json:"steps"` +} + +// Thresholds can either be absolute (specific number) or percentage (relative to min or max). +type ThresholdsMode string + +// Maps text values to a color or different display text +type ValueMap struct { + Options map[string]ValueMappingResult `json:"options"` + Type ValueMapType `json:"type"` +} + +// ValueMapType defines model for ValueMap.Type. +type ValueMapType string + +// Result used as replacement text and color for RegexMap and SpecialValueMap +type ValueMappingResult struct { + Color *string `json:"color,omitempty"` + Icon *string `json:"icon,omitempty"` + Index *int32 `json:"index,omitempty"` + Text *string `json:"text,omitempty"` +} + +// VariableHide defines model for VariableHide. +type VariableHide int + +// FROM: packages/grafana-data/src/types/templateVars.ts +// TODO docs +// TODO what about what's in public/app/features/types.ts? +// TODO there appear to be a lot of different kinds of [template] vars here? if so need a disjunction +type VariableModel struct { + // Ref to a DataSource instance + Datasource *DataSourceRef `json:"datasource,omitempty"` + Description *string `json:"description,omitempty"` + Error map[string]any `json:"error,omitempty"` + Global bool `json:"global"` + Hide VariableHide `json:"hide"` + Id string `json:"id"` + Index int `json:"index"` + Label *string `json:"label,omitempty"` + Name string `json:"name"` + + // TODO: Move this into a separated QueryVariableModel type + Query *any `json:"query,omitempty"` + RootStateKey *string `json:"rootStateKey,omitempty"` + SkipUrlSync bool `json:"skipUrlSync"` + State LoadingState `json:"state"` + + // FROM: packages/grafana-data/src/types/templateVars.ts + // TODO docs + // TODO this implies some wider pattern/discriminated union, probably? + Type VariableType `json:"type"` +} + +// FROM: packages/grafana-data/src/types/templateVars.ts +// TODO docs +// TODO this implies some wider pattern/discriminated union, probably? +type VariableType string diff --git a/internal/cmd/iac/import/grafana/testdata/example.json b/internal/cmd/iac/import/grafana/testdata/example.json new file mode 100644 index 0000000..c49a421 --- /dev/null +++ b/internal/cmd/iac/import/grafana/testdata/example.json @@ -0,0 +1,120 @@ +{ + "id": null, + "uid": "cLV5GDCkz", + "title": "New dashboard", + "tags": [], + "style": "dark", + "timezone": "browser", + "editable": true, + "graphTooltip": 1, + "panels": [ + { + "type": "text", + "title": "Panel Title", + "gridPos": { + "x": 0, + "y": 0, + "w": 12, + "h": 9 + }, + "id": 4, + "mode": "markdown", + "content": "# title" + } + ], + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": { + "collapse": false, + "enable": true, + "notice": false, + "now": true, + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "status": "Stable", + "type": "timepicker" + }, + "templating": { + "enable": true, + "list": [ + { + "allFormat": "wildcard", + "current": { + "tags": [], + "text": "prod", + "value": "prod" + }, + "datasource": null, + "includeAll": true, + "name": "env", + "options": [ + { + "selected": false, + "text": "All", + "value": "*" + }, + { + "selected": false, + "text": "stage", + "value": "stage" + }, + { + "selected": false, + "text": "test", + "value": "test" + } + ], + "query": "tag_values(cpu.utilization.average,env)", + "refresh": false, + "type": "query" + }, + { + "allFormat": "wildcard", + "current": { + "text": "apache", + "value": "apache" + }, + "datasource": null, + "includeAll": false, + "multi": false, + "multiFormat": "glob", + "name": "app", + "options": [ + { + "selected": true, + "text": "tomcat", + "value": "tomcat" + }, + { + "selected": false, + "text": "cassandra", + "value": "cassandra" + } + ], + "query": "tag_values(cpu.utilization.average,app)", + "refresh": false, + "regex": "", + "type": "query" + } + ] + }, + "annotations": { + "list": [] + }, + "refresh": "5s", + "schemaVersion": 17, + "version": 0, + "links": [] +} \ No newline at end of file diff --git a/internal/generator/tfmod/resources/dashboard/resource.go b/internal/generator/tfmod/resources/dashboard/resource.go new file mode 100644 index 0000000..a179f2f --- /dev/null +++ b/internal/generator/tfmod/resources/dashboard/resource.go @@ -0,0 +1,49 @@ +package dashboard + +import ( + _ "embed" + "encoding/json" + "fmt" + + "github.com/GuanceCloud/guance-cli/internal/helpers/osfs" + "github.com/GuanceCloud/guance-cli/internal/helpers/prettier" +) + +var ( + //go:embed template/main.tf + moduleTemplateMain []byte + + //go:embed template/outputs.tf + moduleTemplateOutput []byte + + //go:embed template/variables.tf + moduleTemplateVar []byte + + //go:embed template/versions.tf + moduleTemplateVersion []byte +) + +type Options struct { + Manifest json.RawMessage +} + +func Generate(opts Options) (osfs.Files, error) { + fixedManifest, err := prettier.FormatJSON(opts.Manifest) + if err != nil { + return nil, fmt.Errorf("failed to format manifest: %w", err) + } + var files osfs.Files + for name, content := range map[string][]byte{ + "versions.tf": moduleTemplateVersion, + "manifest.json": fixedManifest, + "main.tf": moduleTemplateMain, + "variables.tf": moduleTemplateVar, + "outputs.tf": moduleTemplateOutput, + } { + files = append(files, osfs.File{ + Path: name, + Content: content, + }) + } + return files, nil +} diff --git a/internal/cmd/iac/template/terraform-module/dashboard/main.tf b/internal/generator/tfmod/resources/dashboard/template/main.tf similarity index 100% rename from internal/cmd/iac/template/terraform-module/dashboard/main.tf rename to internal/generator/tfmod/resources/dashboard/template/main.tf diff --git a/internal/cmd/iac/template/terraform-module/dashboard/outputs.tf b/internal/generator/tfmod/resources/dashboard/template/outputs.tf similarity index 100% rename from internal/cmd/iac/template/terraform-module/dashboard/outputs.tf rename to internal/generator/tfmod/resources/dashboard/template/outputs.tf diff --git a/internal/cmd/iac/template/terraform-module/dashboard/variables.tf b/internal/generator/tfmod/resources/dashboard/template/variables.tf similarity index 100% rename from internal/cmd/iac/template/terraform-module/dashboard/variables.tf rename to internal/generator/tfmod/resources/dashboard/template/variables.tf diff --git a/internal/cmd/iac/template/terraform-module/versions.tf b/internal/generator/tfmod/resources/dashboard/template/versions.tf similarity index 100% rename from internal/cmd/iac/template/terraform-module/versions.tf rename to internal/generator/tfmod/resources/dashboard/template/versions.tf diff --git a/internal/generator/tfmod/resources/monitor/resource.go b/internal/generator/tfmod/resources/monitor/resource.go new file mode 100644 index 0000000..7bd56a9 --- /dev/null +++ b/internal/generator/tfmod/resources/monitor/resource.go @@ -0,0 +1,122 @@ +package monitor + +import ( + _ "embed" + "encoding/json" + "fmt" + + "github.com/GuanceCloud/guance-cli/internal/helpers/prettier" + "github.com/tidwall/gjson" + "github.com/tidwall/sjson" + + "github.com/hashicorp/go-multierror" + + "github.com/GuanceCloud/guance-cli/internal/helpers/osfs" +) + +var ( + //go:embed template/main.tf.gotpl + moduleTemplateMain []byte + + //go:embed template/outputs.tf.gotpl + moduleTemplateOutput []byte + + //go:embed template/variables.tf + moduleTemplateVar []byte + + //go:embed template/versions.tf + moduleTemplateVersion []byte +) + +type Options struct { + Manifests []json.RawMessage +} + +func Generate(opts Options) (osfs.Files, error) { + var files osfs.Files + + // copy template + for name, content := range map[string]json.RawMessage{ + "versions.tf": moduleTemplateVersion, + "variables.tf": moduleTemplateVar, + } { + files = append(files, osfs.File{ + Path: name, + Content: content, + }) + } + + // render template + var mErr error + for name, content := range map[string]json.RawMessage{ + "main.tf": moduleTemplateMain, + "outputs.tf": moduleTemplateOutput, + } { + got, err := osfs.RenderTemplate(content, opts) + if err != nil { + mErr = multierror.Append(mErr, fmt.Errorf("failed to render template %s: %w", name, err)) + } + files = append(files, osfs.File{ + Path: name, + Content: got, + }) + } + if mErr != nil { + return nil, fmt.Errorf("failed to render template: %w", mErr) + } + + // add manifest + for i, manifest := range opts.Manifests { + fixed, err := fixNoData(manifest) + if err != nil { + mErr = multierror.Append(mErr, fmt.Errorf("failed to fix manifest: %w", err)) + } + fixed, err = prettier.FormatJSON(fixed) + if err != nil { + mErr = multierror.Append(mErr, fmt.Errorf("failed to format manifest: %w", err)) + } + files = append(files, osfs.File{ + Path: fmt.Sprintf("manifest-%03d.json", i+1), + Content: fixed, + }) + } + if mErr != nil { + return nil, fmt.Errorf("failed to fix data zero-value: %w", mErr) + } + return nil, nil +} + +func fixNoData(src []byte) ([]byte, error) { + var err error + if gjson.GetBytes(src, "jsonScript.noDataPeriodCount").Int() == 0 { + src, err = sjson.DeleteBytes(src, "jsonScript.noDataPeriodCount") + if err != nil { + return nil, fmt.Errorf("delete noDataPeriodCount error: %w", err) + } + } + if gjson.GetBytes(src, "extend.noDataPeriodCount").Int() == 0 { + src, err = sjson.DeleteBytes(src, "extend.noDataPeriodCount") + if err != nil { + return nil, fmt.Errorf("delete noDataPeriodCount error: %w", err) + } + } + if gjson.GetBytes(src, "jsonScript.noDataMessage").String() == "" { + src, err = sjson.DeleteBytes(src, "jsonScript.noDataMessage") + if err != nil { + return nil, fmt.Errorf("delete noDataMessage error: %w", err) + } + } + if gjson.GetBytes(src, "jsonScript.noDataTitle").String() == "" { + src, err = sjson.DeleteBytes(src, "jsonScript.noDataTitle") + if err != nil { + return nil, fmt.Errorf("delete noDataTitle error: %w", err) + } + } + if !gjson.GetBytes(src, "jsonScript.checkerOpt.infoEvent").Bool() { + src, err = sjson.DeleteBytes(src, "jsonScript.checkerOpt.infoEvent") + if err != nil { + return nil, fmt.Errorf("delete infoEvent error: %w", err) + } + } + return src, nil +} diff --git a/internal/cmd/iac/template/terraform-module/monitor/main.tf.gotpl b/internal/generator/tfmod/resources/monitor/template/main.tf.gotpl similarity index 52% rename from internal/cmd/iac/template/terraform-module/monitor/main.tf.gotpl rename to internal/generator/tfmod/resources/monitor/template/main.tf.gotpl index 3b807a3..31337d2 100644 --- a/internal/cmd/iac/template/terraform-module/monitor/main.tf.gotpl +++ b/internal/generator/tfmod/resources/monitor/template/main.tf.gotpl @@ -1,6 +1,6 @@ -{{ range $_, $index := . }} -resource "guance_monitor" "main_{{ . }}" { - manifest = file("${path.module}/manifest-{{ . }}.json") +{{- range $i, $_ := .Manifests }} +resource "guance_monitor" "main_{{ $i | printf "%02d" }}" { + manifest = file("${path.module}/manifest-{{ $i | printf "%02d" }}.json") alert_policy = var.alert_policy_id == null ? null : { id = var.alert_policy_id diff --git a/internal/cmd/iac/template/terraform-module/monitor/outputs.tf.gotpl b/internal/generator/tfmod/resources/monitor/template/outputs.tf.gotpl similarity index 52% rename from internal/cmd/iac/template/terraform-module/monitor/outputs.tf.gotpl rename to internal/generator/tfmod/resources/monitor/template/outputs.tf.gotpl index 7e8754e..79fce16 100644 --- a/internal/cmd/iac/template/terraform-module/monitor/outputs.tf.gotpl +++ b/internal/generator/tfmod/resources/monitor/template/outputs.tf.gotpl @@ -1,8 +1,8 @@ output "monitor_ids" { description = "The `guance_monitor`'s id." value = [ - {{- range $_, $index := . }} - guance_monitor.main_{{ . }}.id, + {{- range $i, $_ := .Manifests }} + guance_monitor.main_{{ $i | printf "%02d" }}.id, {{- end }} ] } diff --git a/internal/cmd/iac/template/terraform-module/monitor/variables.tf b/internal/generator/tfmod/resources/monitor/template/variables.tf similarity index 100% rename from internal/cmd/iac/template/terraform-module/monitor/variables.tf rename to internal/generator/tfmod/resources/monitor/template/variables.tf diff --git a/specs/iac/import/dashboard/snapshot/versions.tf b/internal/generator/tfmod/resources/monitor/template/versions.tf similarity index 100% rename from specs/iac/import/dashboard/snapshot/versions.tf rename to internal/generator/tfmod/resources/monitor/template/versions.tf diff --git a/internal/helpers/osfs/file.go b/internal/helpers/osfs/file.go new file mode 100644 index 0000000..ba6334a --- /dev/null +++ b/internal/helpers/osfs/file.go @@ -0,0 +1,42 @@ +package osfs + +import ( + "fmt" + "os" + "path" + "path/filepath" + + "github.com/hashicorp/go-multierror" +) + +type Files []File + +func (files Files) Save(output string) error { + var mErr error + for _, file := range files { + file = File{ + Path: path.Join(output, file.Path), + Content: file.Content, + } + if err := file.Save(); err != nil { + mErr = multierror.Append(mErr, fmt.Errorf("save file %s error: %w", file.Path, err)) + continue + } + } + return mErr +} + +type File struct { + Path string + Content []byte +} + +func (f *File) Save() error { + if err := os.MkdirAll(filepath.Dir(f.Path), 0o755); err != nil { + return fmt.Errorf("mkdir %s error: %w", f.Path, err) + } + if err := os.WriteFile(f.Path, f.Content, 0o600); err != nil { + return fmt.Errorf("write file %s error: %w", f.Path, err) + } + return nil +} diff --git a/internal/helpers/osfs/file_test.go b/internal/helpers/osfs/file_test.go new file mode 100644 index 0000000..371dda1 --- /dev/null +++ b/internal/helpers/osfs/file_test.go @@ -0,0 +1,41 @@ +package osfs + +import ( + "os" + "path" + "testing" +) + +func TestFiles_Save(t *testing.T) { + dir, err := os.MkdirTemp("", "test") + if err != nil { + t.Fatalf("failed to create temp dir: %v", err) + } + defer os.RemoveAll(dir) + + files := Files{ + { + Path: "file1.txt", + Content: []byte("hello world"), + }, + { + Path: "file2.txt", + Content: []byte("goodbye world"), + }, + } + + if err := files.Save(dir); err != nil { + t.Fatalf("failed to save files: %v", err) + } + + for _, file := range files { + filePath := path.Join(dir, file.Path) + content, err := os.ReadFile(filePath) + if err != nil { + t.Fatalf("failed to read file %s: %v", filePath, err) + } + if string(content) != string(file.Content) { + t.Errorf("file content mismatch, expected %q but got %q", string(file.Content), string(content)) + } + } +} diff --git a/internal/helpers/osfs/render.go b/internal/helpers/osfs/render.go new file mode 100644 index 0000000..4d632a8 --- /dev/null +++ b/internal/helpers/osfs/render.go @@ -0,0 +1,19 @@ +package osfs + +import ( + "bytes" + "fmt" + "html/template" +) + +func RenderTemplate(templateContent []byte, data any) ([]byte, error) { + tpl, err := template.New("guance").Parse(string(templateContent)) + if err != nil { + return nil, fmt.Errorf("parse template error: %w", err) + } + var buf bytes.Buffer + if err := tpl.Execute(&buf, data); err != nil { + return nil, fmt.Errorf("execute template error: %w", err) + } + return buf.Bytes(), nil +} diff --git a/internal/helpers/osfs/render_test.go b/internal/helpers/osfs/render_test.go new file mode 100644 index 0000000..c969fa1 --- /dev/null +++ b/internal/helpers/osfs/render_test.go @@ -0,0 +1,20 @@ +package osfs + +import ( + "bytes" + "testing" +) + +func TestRenderTemplate(t *testing.T) { + templateContent := []byte("Hello, {{.Name}}!") + data := struct{ Name string }{"World"} + expectedOutput := []byte("Hello, World!") + + output, err := RenderTemplate(templateContent, data) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + if !bytes.Equal(output, expectedOutput) { + t.Errorf("unexpected output: %s", output) + } +} diff --git a/internal/helpers/prettier/json.go b/internal/helpers/prettier/json.go new file mode 100644 index 0000000..1ccbd4f --- /dev/null +++ b/internal/helpers/prettier/json.go @@ -0,0 +1,19 @@ +package prettier + +import ( + "encoding/json" + "fmt" +) + +// FormatJSON will excute formatting for json bytes with indent +func FormatJSON(src []byte) ([]byte, error) { + var m any + if err := json.Unmarshal(src, &m); err != nil { + return nil, fmt.Errorf("unmarshal json error when formatting: %w", err) + } + b, err := json.MarshalIndent(m, "", " ") + if err != nil { + return nil, fmt.Errorf("marshal json error when formatting: %w", err) + } + return b, nil +} diff --git a/internal/helpers/prettier/json_test.go b/internal/helpers/prettier/json_test.go new file mode 100644 index 0000000..5d048d4 --- /dev/null +++ b/internal/helpers/prettier/json_test.go @@ -0,0 +1,41 @@ +package prettier + +import ( + "reflect" + "testing" +) + +func TestFormatJSON(t *testing.T) { + testCases := []struct { + name string + input []byte + expected []byte + wantErr bool + }{ + { + name: "valid json", + input: []byte(`{"name":"John","age":30,"city":"New York"}`), + expected: []byte("{\n \"age\": 30,\n \"city\": \"New York\",\n \"name\": \"John\"\n}"), + wantErr: false, + }, + { + name: "invalid json", + input: []byte(`{"name":"John","age":30,"city":"New York"`), + expected: nil, + wantErr: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + actual, err := FormatJSON(tc.input) + if (err != nil) != tc.wantErr { + t.Errorf("FormatJSON() error = %v, wantErr %v", err, tc.wantErr) + return + } + if !reflect.DeepEqual(actual, tc.expected) { + t.Errorf("FormatJSON() = %v, want %v", string(actual), string(tc.expected)) + } + }) + } +} diff --git a/internal/helpers/prettier/space.go b/internal/helpers/prettier/space.go new file mode 100644 index 0000000..69f7d80 --- /dev/null +++ b/internal/helpers/prettier/space.go @@ -0,0 +1,16 @@ +package prettier + +import ( + "strings" + "unicode" +) + +// RemoveSpaces removes all spaces from a string. +func RemoveSpaces(s string) string { + return strings.Map(func(r rune) rune { + if unicode.IsSpace(r) { + return -1 + } + return r + }, s) +} diff --git a/internal/helpers/prettier/space_test.go b/internal/helpers/prettier/space_test.go new file mode 100644 index 0000000..3591309 --- /dev/null +++ b/internal/helpers/prettier/space_test.go @@ -0,0 +1,47 @@ +package prettier + +import "testing" + +func TestRemoveSpaces(t *testing.T) { + tests := []struct { + name string + args string + want string + }{ + { + name: "removes spaces", + args: "hello world", + want: "helloworld", + }, + { + name: "removes tabs", + args: "hello\tworld", + want: "helloworld", + }, + { + name: "removes newlines", + args: "hello\nworld", + want: "helloworld", + }, + { + name: "removes all spaces", + args: " hello \t\n world ", + want: "helloworld", + }, + { + name: "handles empty string", + args: "", + want: "", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if got := RemoveSpaces(tt.args); got != tt.want { + t.Errorf("removeSpaces() = %v, want %v", got, tt.want) + } + }) + } +} + +// END: 8f7e6d5c3b2a diff --git a/internal/helpers/types/codec.go b/internal/helpers/types/codec.go new file mode 100644 index 0000000..d7baa91 --- /dev/null +++ b/internal/helpers/types/codec.go @@ -0,0 +1,22 @@ +package types + +import ( + "fmt" + + "github.com/mitchellh/mapstructure" +) + +func Decode(in map[string]any, out any) error { + decoder, err := mapstructure.NewDecoder(&mapstructure.DecoderConfig{ + Result: out, + TagName: "json", + WeaklyTypedInput: true, + }) + if err != nil { + return fmt.Errorf("new decoder failed: %w", err) + } + if err := decoder.Decode(in); err != nil { + return fmt.Errorf("decode map failed: %w", err) + } + return decoder.Decode(in) +} diff --git a/internal/helpers/types/float.go b/internal/helpers/types/float.go new file mode 100644 index 0000000..b49551f --- /dev/null +++ b/internal/helpers/types/float.go @@ -0,0 +1,29 @@ +package types + +// Float64 returns a pointer to the float64 value passed in. +func Float64(v float64) *float64 { + return &v +} + +// Float64Value returns the value of the float64 pointer passed in or +// an empty float64 if the pointer is nil. +func Float64Value(v *float64) float64 { + if v == nil { + return 0 + } + return *v +} + +// Float32 returns a pointer to the float32 value passed in. +func Float32(v float32) *float32 { + return &v +} + +// Float32Value returns the value of the float32 pointer passed in or +// an empty float32 if the pointer is nil. +func Float32Value(v *float32) float32 { + if v == nil { + return 0 + } + return *v +} diff --git a/internal/helpers/types/string.go b/internal/helpers/types/string.go new file mode 100644 index 0000000..db2c95a --- /dev/null +++ b/internal/helpers/types/string.go @@ -0,0 +1,15 @@ +package types + +// String returns a pointer to the string value passed in. +func String(v string) *string { + return &v +} + +// StringValue returns the value of the string pointer passed in or +// an empty string if the pointer is nil. +func StringValue(v *string) string { + if v == nil { + return "" + } + return *v +} diff --git a/internal/magefiles/run.go b/internal/magefiles/run.go index e0acbfa..994409c 100644 --- a/internal/magefiles/run.go +++ b/internal/magefiles/run.go @@ -4,12 +4,6 @@ package main import ( - "fmt" - "io/fs" - "os" - "path/filepath" - "strings" - "github.com/hashicorp/go-multierror" "github.com/magefile/mage/mg" "github.com/magefile/mage/sh" @@ -17,59 +11,11 @@ import ( type Run mg.Namespace -const ( - GaugeSpecDir = "specs" - GaugeProjectDir = "internal/testing" -) - // Install run the installation in local func (ns Run) Install() error { return sh.RunV("go", "install", "./cmd/...") } -// Test run all test specifications -func (ns Run) Test() error { - mg.Deps(ns.Install) - - // Copy the specs to the project directory - err := filepath.Walk(GaugeSpecDir, func(path string, info fs.FileInfo, err error) error { - if info.IsDir() { - return nil - } - - if !strings.HasSuffix(path, ".spec.md") { - return nil - } - - // Copy the file to the project directory - srcBytes, err := os.ReadFile(path) - if err != nil { - return fmt.Errorf("read file %s failed: %w", path, err) - } - relPath, err := filepath.Rel(GaugeSpecDir, path) - if err != nil { - return fmt.Errorf("get relative path failed: %w", err) - } - dstPath := filepath.Join(GaugeProjectDir, "specs", relPath[:len(relPath)-3]) - if err := os.MkdirAll(filepath.Dir(dstPath), 0o755); err != nil { - return fmt.Errorf("make dir %s failed: %w", filepath.Dir(dstPath), err) - } - if err := os.WriteFile(dstPath, srcBytes, 0o644); err != nil { - return fmt.Errorf("write file %s failed: %w", dstPath, err) - } - return nil - }) - if err != nil { - return fmt.Errorf("walk specs failed: %w", err) - } - - // Run gauge - if err := sh.RunV("gauge", "run", filepath.Join(GaugeProjectDir, "specs")); err != nil { - return fmt.Errorf("run gauge failed: %w", err) - } - return nil -} - // Lint run the linter func (ns Run) Lint() error { argList := [][]string{ @@ -85,6 +31,7 @@ func (ns Run) Fmt() error { argList := [][]string{ {"golangci-lint", "run", "--fix", "./..."}, {"gofumpt", "-l", "-w", "."}, + {"goimports", "-w", "."}, {"prettier", "-w", "**/*.md"}, } return batchRunV(argList) diff --git a/internal/magefiles/test.go b/internal/magefiles/test.go new file mode 100644 index 0000000..ff364d2 --- /dev/null +++ b/internal/magefiles/test.go @@ -0,0 +1,88 @@ +//go:build mage +// +build mage + +package main + +import ( + "fmt" + "io/fs" + "os" + "path/filepath" + "strings" + + "github.com/magefile/mage/mg" + "github.com/magefile/mage/sh" +) + +type Test mg.Namespace + +const ( + GaugeSpecDir = "specs" + GaugeProjectDir = "internal/testing" +) + +func (ns Test) Unit() error { + if err := sh.RunV("go", "test", "-v", "-cover", "-coverprofile=cover.out", "./..."); err != nil { + return fmt.Errorf("run unit test failed: %w", err) + } + if err := sh.RunV("go", "tool", "cover", "-func=cover.out"); err != nil { + return fmt.Errorf("generate coverage report failed: %w", err) + } + return nil +} + +// Acc run all test specifications for acceptance testing +func (ns Test) Acc() error { + // Copy the specs to the project directory + err := filepath.Walk(GaugeSpecDir, func(path string, info fs.FileInfo, err error) error { + if info.IsDir() { + return nil + } + + if info.Name() == "README.md" { + return nil + } + + // Copy the file to the project directory + srcBytes, err := os.ReadFile(path) + if err != nil { + return fmt.Errorf("read file %s failed: %w", path, err) + } + relPath, err := filepath.Rel(GaugeSpecDir, path) + if err != nil { + return fmt.Errorf("get relative path failed: %w", err) + } + if strings.HasSuffix(path, ".spec.md") { + relPath = strings.ReplaceAll(relPath, ".spec.md", ".spec") + } + dstPath := filepath.Join(GaugeProjectDir, "specs", relPath) + if err := os.MkdirAll(filepath.Dir(dstPath), 0o755); err != nil { + return fmt.Errorf("make dir %s failed: %w", filepath.Dir(dstPath), err) + } + if err := os.WriteFile(dstPath, srcBytes, 0o644); err != nil { + return fmt.Errorf("write file %s failed: %w", dstPath, err) + } + return nil + }) + if err != nil { + return fmt.Errorf("walk specs failed: %w", err) + } + + // Get the root of Gauge files + cwd, err := os.Getwd() + if err != nil { + return fmt.Errorf("cannot get current directory: %w", err) + } + gaugeRoot, err := filepath.Abs(filepath.Join(cwd, "specs")) + if err != nil { + return fmt.Errorf("cannot get gauge root: %w", err) + } + + // Run gauge + if err := sh.RunWithV(map[string]string{ + "GAUGE_ROOT": gaugeRoot, + }, "gauge", "run", filepath.Join(GaugeProjectDir, "specs")); err != nil { + return fmt.Errorf("run gauge failed: %w", err) + } + return nil +} diff --git a/internal/testing/specs/iac/import.spec b/internal/testing/specs/iac/import.spec deleted file mode 100644 index 7c9837d..0000000 --- a/internal/testing/specs/iac/import.spec +++ /dev/null @@ -1,6 +0,0 @@ -# Test import Guance resources from console exported file - -## Import Dashboard - -* Run "guance iac import -s console -f ./dashboard.json -t terraform-module -o ./out" -* Check folder "out" is exists diff --git a/internal/testing/stepimpl/stepimpl.go b/internal/testing/stepimpl/stepimpl.go index e12b31f..41f0ada 100644 --- a/internal/testing/stepimpl/stepimpl.go +++ b/internal/testing/stepimpl/stepimpl.go @@ -11,6 +11,11 @@ import ( ) var _ = gauge.Step(`Run `, func(command string) { + gaugeRoot := os.Getenv("GAUGE_ROOT") + if err := os.Chdir(gaugeRoot); err != nil { + testsuit.T.Fail(fmt.Errorf("cannot change directory to the Gauge root: %s, %w", gaugeRoot, err)) + } + // Build command tokens := strings.Split(command, " ") binary, err := exec.LookPath(tokens[0]) diff --git a/proposals/A001-guance-cli-overview.md b/proposals/A001-guance-cli-overview.md index d943887..a7fb4f5 100644 --- a/proposals/A001-guance-cli-overview.md +++ b/proposals/A001-guance-cli-overview.md @@ -1,10 +1,10 @@ -A001: Guance CLI Overview ----- -* Author(s): yufeiminds -* Approver: yufeiminds -* Status: Implemented -* Last updated: 2023-05-12 -* Discussion at: GitHub issues (comma separated, filled after thread exists) +# A001: Guance CLI Overview + +- Author(s): yufeiminds +- Approver: yufeiminds +- Status: Implemented +- Last updated: 2023-05-12 +- Discussion at: GitHub issues (comma separated, filled after thread exists) ## Abstract @@ -22,9 +22,9 @@ CLI is an important developer tool for SaaS vendors. It is instead of the GUI as When using Cloud in the real world, there are three ways to interact with it: -* **Imperative** APIs and tools use action words to explain how to operate a specific resource. Examples of imperative APIs include RESTFul and Action. -* **Declarative** APIs and tools only describe the resource that is needed. The specific actions are automatically carried out by the platform or tool. For instance, Kubernetes Operator and Terraform compare the current resource state with the expected state to make decisions and execute orchestration logic. -* **Interactive** tools are designed to move users step by step toward their goals. The API debugger allows users to keep adjusting parameters and initiating requests until they achieve the desired outcome. +- **Imperative** APIs and tools use action words to explain how to operate a specific resource. Examples of imperative APIs include RESTFul and Action. +- **Declarative** APIs and tools only describe the resource that is needed. The specific actions are automatically carried out by the platform or tool. For instance, Kubernetes Operator and Terraform compare the current resource state with the expected state to make decisions and execute orchestration logic. +- **Interactive** tools are designed to move users step by step toward their goals. The API debugger allows users to keep adjusting parameters and initiating requests until they achieve the desired outcome. Guance CLI is focused on **imperative** commands. It is a tool to help users interact with Guance Cloud. @@ -56,10 +56,10 @@ Guance CLI supports the 1 and 3 to develop the command. 1 to provide official fe In Guance Cloud, We have a configuration convention for all the developer tools. In this convention: 1. All developer tools must accept the well-known environment variables. - * `GUANCE_ACCESS_TOKEN`: The access token of Guance Cloud. It can be generated at [Guance Cloud Console](https://console.guance.com). - * `GUANCE_REGION`: The region of Guance Cloud. + - `GUANCE_ACCESS_TOKEN`: The access token of Guance Cloud. It can be generated at [Guance Cloud Console](https://console.guance.com). + - `GUANCE_REGION`: The region of Guance Cloud. 2. All developer tools must accept the well-known configuration file. - * `~/.guance/config.yaml`: The configuration file of Guance Cloud. It can be generated by the `guance auth login` command. + - `~/.guance/config.yaml`: The configuration file of Guance Cloud. It can be generated by the `guance auth login` command. Guance CLI will use [Viper](https://github.com/spf13/viper) to parse the configuration convention to provide the best user experience. @@ -82,7 +82,7 @@ A simple example is shown below: ## Show version -* Run `guance version` +- Run `guance version` ``` After the run, the testing framework will execute the command, and the result will be verified. diff --git a/proposals/C001-continuous-integration-jmeter.md b/proposals/C001-continuous-integration-jmeter.md index f20f843..d9b078c 100644 --- a/proposals/C001-continuous-integration-jmeter.md +++ b/proposals/C001-continuous-integration-jmeter.md @@ -1,10 +1,10 @@ -C001: Continuous Integration JMeter ----- -* Author(s): @yufeiminds -* Approver: @coanor -* Status: In Review -* Last updated: 2023-05-14 -* Discussion at: GitHub issues (comma separated, filled after thread exists) +# C001: Continuous Integration JMeter + +- Author(s): @yufeiminds +- Approver: @coanor +- Status: In Review +- Last updated: 2023-05-14 +- Discussion at: GitHub issues (comma separated, filled after thread exists) ## Abstract @@ -33,39 +33,39 @@ This proposal focuses on the **acceptance testing** use case. We should implement a new sub-command `guance ci upload jmeter` to upload JMeter logs to Guance Cloud. -|Argument|Description| -|:--|:--| -| `tags` | The tags of the request.
**Examples**: `--tags k1:v1 --tags k2:v2` | -| `service` | The service name.
**Examples**: `foo` | -| `env` | The environment identifier.
**Examples**: `production` | +| Argument | Description | +| :-------- | :----------------------------------------------------------------------- | +| `tags` | The tags of the request.
**Examples**: `--tags k1:v1 --tags k2:v2` | +| `service` | The service name.
**Examples**: `foo` | +| `env` | The environment identifier.
**Examples**: `production` | ### Collect JMeter logging The JMeter logs contain the following tags: -|Tag|Description| -|:--|:--| -| `label` | The label of the request.
**Examples**: `Upload Metrics Data`| -| `responseCode` | The response code of the request.
**Examples**: `200`| -| `responseMessage` | The response message of the request.
**Examples**: `OK`| -| `threadName` | The thread name of the request.
**Examples**: `Thread Group 1-1`| -| `dataType` | The data type of the request.
**Examples**: `text`| -| `success` | The success of the request.
**Examples**: `true`| -| `failureMessage` | The failure message of the request.
**Examples**: `Test failed: code expected to contain /200/`| +| Tag | Description | +| :---------------- | :---------------------------------------------------------------------------------------------------- | +| `label` | The label of the request.
**Examples**: `Upload Metrics Data` | +| `responseCode` | The response code of the request.
**Examples**: `200` | +| `responseMessage` | The response message of the request.
**Examples**: `OK` | +| `threadName` | The thread name of the request.
**Examples**: `Thread Group 1-1` | +| `dataType` | The data type of the request.
**Examples**: `text` | +| `success` | The success of the request.
**Examples**: `true` | +| `failureMessage` | The failure message of the request.
**Examples**: `Test failed: code expected to contain /200/` | The JMeter logs contain the following fields: -|Field|Description| -|:--|:--| -| `elasped` | The elapsed time of the request.
**Examples**: `2615`| -| `bytes` | The bytes of the request.
**Examples**: `496`| -| `sentBytes` | The sent bytes of the request.
**Examples**: `608`| -| `grpThreads` | The group threads of the request.
**Examples**: `147`| -| `allThreads` | All threads of the request.
**Examples**: `147` | -| `URL` | The URL of the request.
**Examples**: `https://openway.guance.com/v1/write/metric?token=...`| -| `Latency` | The latency of the request.
**Examples**: `2610`| -| `IdleTime` | The idle time of the request.
**Examples**: `0`| -| `Connect` | The connect time of the request.
**Examples**: `1665`| +| Field | Description | +| :----------- | :------------------------------------------------------------------------------------------------- | +| `elasped` | The elapsed time of the request.
**Examples**: `2615` | +| `bytes` | The bytes of the request.
**Examples**: `496` | +| `sentBytes` | The sent bytes of the request.
**Examples**: `608` | +| `grpThreads` | The group threads of the request.
**Examples**: `147` | +| `allThreads` | All threads of the request.
**Examples**: `147` | +| `URL` | The URL of the request.
**Examples**: `https://openway.guance.com/v1/write/metric?token=...` | +| `Latency` | The latency of the request.
**Examples**: `2610` | +| `IdleTime` | The idle time of the request.
**Examples**: `0` | +| `Connect` | The connect time of the request.
**Examples**: `1665` | The typical JMeter logging example is shown below: @@ -81,29 +81,29 @@ It is a CSV format. The first line is the header. The following lines are the JM The Git-related information contains the following tags: -|Tag|Description| -|:--|:--| -|`git_repository_url`|The URL of the git repository.
**Examples**: `https://github.com/GuanceCloud/community.git`| -|`git_branch`|The branch of the git repository.
**Examples**: `main`| -|`git_tag`|The tag of the git repository.
**Examples**: `v1.0.0`| -|`git_commit_sha`|The commit sha consists of the git repository.
**Examples**: `b1b9c2c`| -|`git_message`|The message of the git repository.
**Examples**: `docs: Add JMeter documentation`| -|`git_author_name`|The author name of the git repository.
**Examples**: `guance-bot`| -|`git_author_email`|The author email of the git repository.
**Examples**: `developer@guance.com` | -|`git_author_date`|The author date of the git repository.
**Examples**: `2021-05-14T08:00:00Z`| -|`git_committer_name`|The committer name of the git repository.
**Examples**: `guance-bot`| -|`git_committer_email`|The committer email of the git repository.
**Examples**: `developer@guance.com` | -|`git_committer_date`|The committer date of the git repository.
**Examples**: `2021-05-14T08:00:00Z`| +| Tag | Description | +| :-------------------- | :----------------------------------------------------------------------------------------------- | +| `git_repository_url` | The URL of the git repository.
**Examples**: `https://github.com/GuanceCloud/community.git` | +| `git_branch` | The branch of the git repository.
**Examples**: `main` | +| `git_tag` | The tag of the git repository.
**Examples**: `v1.0.0` | +| `git_commit_sha` | The commit sha consists of the git repository.
**Examples**: `b1b9c2c` | +| `git_message` | The message of the git repository.
**Examples**: `docs: Add JMeter documentation` | +| `git_author_name` | The author name of the git repository.
**Examples**: `guance-bot` | +| `git_author_email` | The author email of the git repository.
**Examples**: `developer@guance.com` | +| `git_author_date` | The author date of the git repository.
**Examples**: `2021-05-14T08:00:00Z` | +| `git_committer_name` | The committer name of the git repository.
**Examples**: `guance-bot` | +| `git_committer_email` | The committer email of the git repository.
**Examples**: `developer@guance.com` | +| `git_committer_date` | The committer date of the git repository.
**Examples**: `2021-05-14T08:00:00Z` | ### Collect Runtime-related information The Runtime-related information contains the following tags: -|Tag|Description| -|:--|:--| -|`platform`|The platform of the environment.
**Examples**: `windows`, `darwin`, `linux`| -|`arch`|The architecture of the environment.
**Examples**: `amd64`, `arm64`| -|`os`|The operating system of the environment.
**Examples**: `windows 10`, `macos 11.3.1`, `ubuntu 20.04`| +| Tag | Description | +| :--------- | :------------------------------------------------------------------------------------------------------- | +| `platform` | The platform of the environment.
**Examples**: `windows`, `darwin`, `linux` | +| `arch` | The architecture of the environment.
**Examples**: `amd64`, `arm64` | +| `os` | The operating system of the environment.
**Examples**: `windows 10`, `macos 11.3.1`, `ubuntu 20.04` | ## Rationale @@ -111,8 +111,8 @@ The Runtime-related information contains the following tags: The running time is the crucial difference between the Guance CLI and DataKit Plugin. -* The Guance CLI is a short-time running process. It will only execute once in the continuous integration pipelines. And you can easily integrate it with most of the open-source CI pipeline ecosystems, such as GitHub Action, GitLab CI, etc. -* The DataKit Plugin is a long-time running process. In most use cases, it will collect the metrics by the scheduler or stream living. It will keep running in any client workload, such as Virtual Machine, Kubernetes, etc. +- The Guance CLI is a short-time running process. It will only execute once in the continuous integration pipelines. And you can easily integrate it with most of the open-source CI pipeline ecosystems, such as GitHub Action, GitLab CI, etc. +- The DataKit Plugin is a long-time running process. In most use cases, it will collect the metrics by the scheduler or stream living. It will keep running in any client workload, such as Virtual Machine, Kubernetes, etc. So in a real-world use case. We generally use the Guance CLI and DataKit JMeter Plugin both. The CLI is used in the development stage, helping us to manage the **SDLC (Software Development Life Cycle)**. The DataKit Plugin is used in the production stage to help us to manage the **SLO (Service Level Objective)**. We use both in Guance Cloud to help us manage all the metrics data and archive **Testing Observability**. diff --git a/proposals/C002-importer-grafana.md b/proposals/C002-importer-grafana.md index d8a1493..37f195c 100644 --- a/proposals/C002-importer-grafana.md +++ b/proposals/C002-importer-grafana.md @@ -1,9 +1,9 @@ -C002: Grafana Importer ----- -* Author(s): @yufeiminds -* Approver: @coanor -* Status: Draft -* Last updated: 2023-06-07 +# C002: Grafana Importer + +- Author(s): @yufeiminds +- Approver: @coanor +- Status: Draft +- Last updated: 2023-06-07 ## Abstract @@ -31,7 +31,7 @@ The demo is like this: Most of the work in this proposal is: **How to build the data model for Grafana and Guance Cloud**. Because in software engineering, the static type is also a contract of system edge. -A determined type can make the Grafana importer's behavior exactly. +A determined type can make the Grafana importer's behavior exactly. 1. The Guance Cloud model is described in the [json-model repository](https://github.com/GuanceCloud/json-model). 2. The Grafana model is described in the [grafana repository](https://github.com/grafana/grafana/blob/main/kinds/dashboard/dashboard_kind.cue). @@ -41,12 +41,12 @@ A determined type can make the Grafana importer's behavior exactly. All features of Grafana importer are listed here: | Grafana Panel Type | Guance Chart Type | Implemented? | All Features Supported? | -| ------------------ |-------------------|--------------| ----------------------- | -| bar gauge | bar | YES | [Partial](#BarGauge) | -| gauge | gauge | YES | [Partial](#Gauge) | -| stat | singlestat | YES | [Partial](#Stat) | -| time series | sequence | YES | [Partial](#TimeSeries) | -| table | table | YES | [Partial](#Table) | +| ------------------ | ----------------- | ------------ | ----------------------- | +| bar gauge | bar | YES | [Partial](#bargauge) | +| gauge | gauge | YES | [Partial](#gauge) | +| stat | singlestat | YES | [Partial](#stat) | +| time series | sequence | YES | [Partial](#timeseries) | +| table | table | YES | [Partial](#table) | | pie | pie | NO | | | barchart | bar | NO | | | text | text | NO | | @@ -89,7 +89,7 @@ According to [Guance Cloud PromQL] documentation (in chinese), Guance has a spec For example: -* The `node_network_receive_bytes_total` should be renamed as `node:network_receive_bytes_total`. +- The `node_network_receive_bytes_total` should be renamed as `node:network_receive_bytes_total`. So Guance CLI will auto do this convert by PromQL AST when importing. You can also add customized measurement by CLI flag. diff --git a/specs/guance.spec.md b/specs/guance.spec.md index 1f43f0c..d664e36 100644 --- a/specs/guance.spec.md +++ b/specs/guance.spec.md @@ -1,16 +1,18 @@ # Test Guance Installation -The details of CLI usage can be found in [reference documentations](../../docs/references/guance.md). +The details of CLI usage can be found in [reference documentations](../docs/references/guance.md). ## Show version -- Run "guance version" +* Run "guance version" ## Show help -- Run "guance help" -- Run "guance -h" +* Run "guance help" +* Run "guance -h" ## Install completion -- Run "guance completion zsh > "${HOME}/.zsh_completions/_guance"" +When using Guance CLI, you can use the TAB key to auto-complete the command and options. + +* Run "guance completion zsh" diff --git a/specs/iac/import/console.spec.md b/specs/iac/import/console.spec.md deleted file mode 100644 index 2ec8a9e..0000000 --- a/specs/iac/import/console.spec.md +++ /dev/null @@ -1,11 +0,0 @@ -# Test import Guance resources from console exported file - -The details of CLI usage can be found in [reference documentations](../../docs/references/guance_iac_import.md). - -## Import Dashboard - -- Run "guance iac import console -r dashboard -f ./dashboard/input.json -t terraform-module -o ./out" - -## Import Monitor - -- Run "guance iac import console -r monitor -f ./monitor/input.json -t terraform-module -o ./out" diff --git a/specs/iac/import/console/console.spec.md b/specs/iac/import/console/console.spec.md new file mode 100644 index 0000000..3d2233e --- /dev/null +++ b/specs/iac/import/console/console.spec.md @@ -0,0 +1,11 @@ +# Test import Guance resources from console exported file + +The details of CLI usage can be found in [reference documentations](../../../../docs/references/guance_iac_import_console.md). + +## Import Dashboard + +* Run "guance iac import console -r dashboard -f ./iac/import/console/dashboard/input.json -t terraform-module -o ./out" + +## Import Monitor + +* Run "guance iac import console -r monitor -f ./iac/import/console/monitor/input.json -t terraform-module -o ./out" diff --git a/specs/iac/import/dashboard/input.json b/specs/iac/import/console/dashboard/input.json similarity index 100% rename from specs/iac/import/dashboard/input.json rename to specs/iac/import/console/dashboard/input.json diff --git a/specs/iac/import/dashboard/snapshot/main.tf b/specs/iac/import/console/dashboard/snapshot/main.tf similarity index 100% rename from specs/iac/import/dashboard/snapshot/main.tf rename to specs/iac/import/console/dashboard/snapshot/main.tf diff --git a/specs/iac/import/dashboard/snapshot/manifest.json b/specs/iac/import/console/dashboard/snapshot/manifest.json similarity index 100% rename from specs/iac/import/dashboard/snapshot/manifest.json rename to specs/iac/import/console/dashboard/snapshot/manifest.json diff --git a/specs/iac/import/dashboard/snapshot/outputs.tf b/specs/iac/import/console/dashboard/snapshot/outputs.tf similarity index 100% rename from specs/iac/import/dashboard/snapshot/outputs.tf rename to specs/iac/import/console/dashboard/snapshot/outputs.tf diff --git a/specs/iac/import/dashboard/snapshot/variables.tf b/specs/iac/import/console/dashboard/snapshot/variables.tf similarity index 100% rename from specs/iac/import/dashboard/snapshot/variables.tf rename to specs/iac/import/console/dashboard/snapshot/variables.tf diff --git a/specs/iac/import/monitor/snapshot/versions.tf b/specs/iac/import/console/dashboard/snapshot/versions.tf similarity index 100% rename from specs/iac/import/monitor/snapshot/versions.tf rename to specs/iac/import/console/dashboard/snapshot/versions.tf diff --git a/specs/iac/import/monitor/input.json b/specs/iac/import/console/monitor/input.json similarity index 100% rename from specs/iac/import/monitor/input.json rename to specs/iac/import/console/monitor/input.json diff --git a/specs/iac/import/monitor/snapshot/main.tf b/specs/iac/import/console/monitor/snapshot/main.tf similarity index 100% rename from specs/iac/import/monitor/snapshot/main.tf rename to specs/iac/import/console/monitor/snapshot/main.tf diff --git a/specs/iac/import/monitor/snapshot/manifest-001.json b/specs/iac/import/console/monitor/snapshot/manifest-001.json similarity index 100% rename from specs/iac/import/monitor/snapshot/manifest-001.json rename to specs/iac/import/console/monitor/snapshot/manifest-001.json diff --git a/specs/iac/import/monitor/snapshot/manifest-002.json b/specs/iac/import/console/monitor/snapshot/manifest-002.json similarity index 100% rename from specs/iac/import/monitor/snapshot/manifest-002.json rename to specs/iac/import/console/monitor/snapshot/manifest-002.json diff --git a/specs/iac/import/monitor/snapshot/outputs.tf b/specs/iac/import/console/monitor/snapshot/outputs.tf similarity index 100% rename from specs/iac/import/monitor/snapshot/outputs.tf rename to specs/iac/import/console/monitor/snapshot/outputs.tf diff --git a/specs/iac/import/monitor/snapshot/variables.tf b/specs/iac/import/console/monitor/snapshot/variables.tf similarity index 100% rename from specs/iac/import/monitor/snapshot/variables.tf rename to specs/iac/import/console/monitor/snapshot/variables.tf diff --git a/specs/iac/import/console/monitor/snapshot/versions.tf b/specs/iac/import/console/monitor/snapshot/versions.tf new file mode 100644 index 0000000..a21c1dd --- /dev/null +++ b/specs/iac/import/console/monitor/snapshot/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + guance = { + source = "GuanceCloud/guance" + } + } +} diff --git a/specs/iac/import/grafana.spec.md b/specs/iac/import/grafana.spec.md deleted file mode 100644 index 70b882d..0000000 --- a/specs/iac/import/grafana.spec.md +++ /dev/null @@ -1 +0,0 @@ -# Test import Grafana Dashboard into Guance Cloud diff --git a/specs/iac/import/grafana/config/datakit.conf b/specs/iac/import/grafana/config/datakit.conf new file mode 100644 index 0000000..2d81cf1 --- /dev/null +++ b/specs/iac/import/grafana/config/datakit.conf @@ -0,0 +1,78 @@ +enable_pprof = false +pprof_listen = "" +protect_mode = true +ulimit = 64000 + +[dca] + enable = false + listen = "0.0.0.0:9531" + white_list = [] + +[pipeline] + ipdb_type = "-" + remote_pull_interval = "1m" + refer_table_url = "" + refer_table_pull_interval = "5m" + use_sqlite = false + sqlite_mem_mode = false + +[logging] + log = "/var/log/datakit/log" + gin_log = "/var/log/datakit/gin.log" + level = "info" + disable_color = false + rotate = 32 + +[http_api] + rum_origin_ip_header = "X-Forwarded-For" + listen = "localhost:9529" + disable_404page = false + rum_app_id_white_list = [] + public_apis = [] + timeout = "30s" + close_idle_connection = false + +[io] + feed_chan_size = 1 + max_cache_count = 1000 + flush_interval = "10s" + flush_workers = 0 + output_file = "" + output_file_inputs = [] + enable_cache = false + cache_all = false + cache_max_size_gb = 10 + cache_clean_interval = "5s" + +[dataway] + urls = ["https://openway.guance.com?token="] + timeout = "" + http_proxy = "" + max_idle_conns_per_host = 0 + +[global_host_tags] + +[environments] + ENV_HOSTNAME = "" + +[cgroup] + path = "/datakit" + cpu_max = 20.0 + mem_max_mb = 4096 + enable = true + +[election] + enable = false + enable_namespace_tag = false + namespace = "default" + [election.tags] + +[git_repos] + pull_interval = "1m" + + [[git_repos.repo]] + enable = false + url = "" + ssh_private_key_path = "" + ssh_private_key_password = "" + branch = "master" diff --git a/specs/iac/import/grafana/config/docker-compose.yml b/specs/iac/import/grafana/config/docker-compose.yml new file mode 100644 index 0000000..3019769 --- /dev/null +++ b/specs/iac/import/grafana/config/docker-compose.yml @@ -0,0 +1,23 @@ +version: '3' + +services: + node-exporter: + image: prom/node-exporter + ports: + - "9100:9100" + networks: + - app-network + datakit: + image: guancecloud/datakit:1.6.3-alpha + ports: + - "8080:8080" + networks: + - app-network + environment: + - ENV_DATAWAY=https://openway.guance.com?token=${GUANCE_WORKSPACE_TOKEN} + volumes: + - ./datakit.conf:/usr/local/datakit/conf.d/datakit.conf + - ./prom.conf:/usr/local/datakit/conf.d/prom/prom.conf + +networks: + app-network: diff --git a/specs/iac/import/grafana/config/preview.png b/specs/iac/import/grafana/config/preview.png new file mode 100644 index 0000000..dd6d325 --- /dev/null +++ b/specs/iac/import/grafana/config/preview.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31f6d7ceaa02327bfebebb59f6f0709488bebe9fa675804e8f9dbdadcbe4ac85 +size 535933 diff --git a/specs/iac/import/grafana/config/prom.conf b/specs/iac/import/grafana/config/prom.conf new file mode 100644 index 0000000..a49a37a --- /dev/null +++ b/specs/iac/import/grafana/config/prom.conf @@ -0,0 +1,8 @@ +[[inputs.prom]] + url = "http://node-exporter:9100/metrics" + source = "prom" + metric_types = [] + interval = "60s" + measurement_name = "prom" + [inputs.prom.tags] + job = "DataKit" diff --git a/specs/iac/import/grafana/grafana.spec.md b/specs/iac/import/grafana/grafana.spec.md new file mode 100644 index 0000000..e72cf39 --- /dev/null +++ b/specs/iac/import/grafana/grafana.spec.md @@ -0,0 +1,32 @@ +# Test import Grafana Dashboard into Guance Cloud + +The details of CLI usage can be found in [reference documentations](../../../../docs/references/guance_iac_import_grafana.md). + +![Preview](config/preview.png) + +## Import Dashboard + +You can use Prometheus exporter and DataKit agent to collect and upload the metrics to Guance Cloud. + +For example, the DataKit config is: + +```toml +[[inputs.prom]] + url = "http://node-exporter:9100/metrics" + source = "prom" + metric_types = [] + interval = "60s" + measurement_name = "prom" + [inputs.prom.tags] + job = "DataKit" +``` + +Then download the [Node Exporter Dashboard on Grafana](https://grafana.com/grafana/dashboards/1860-node-exporter-full/). + +Then run the Guance CLI to import the downloaded JSON. + +* Run "guance iac import grafana -f ./iac/import/grafana/input.json -t terraform-module -o ./out" + +You will get a Terraform module at `./out` folder. So you can apply it to create the real dashboard resources on Guance Cloud. + +You can also see [./config](config/) folder for a complete code example. diff --git a/specs/iac/import/grafana/input.json b/specs/iac/import/grafana/input.json new file mode 100644 index 0000000..3fb5d6c --- /dev/null +++ b/specs/iac/import/grafana/input.json @@ -0,0 +1,23367 @@ +{ + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__elements": {}, + "__requires": [ + { + "type": "panel", + "id": "gauge", + "name": "Gauge", + "version": "" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "9.4.3" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + }, + { + "type": "panel", + "id": "stat", + "name": "Stat", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "$$hashKey": "object:1058", + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 1860, + "graphTooltip": 1, + "id": null, + "links": [ + { + "icon": "external link", + "tags": [], + "targetBlank": true, + "title": "GitHub", + "type": "link", + "url": "https://github.com/rfmoz/grafana-dashboards" + }, + { + "icon": "external link", + "tags": [], + "targetBlank": true, + "title": "Grafana", + "type": "link", + "url": "https://grafana.com/grafana/dashboards/1860" + } + ], + "liveNow": false, + "panels": [ + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 261, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Quick CPU / Mem / Disk", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Busy state of all CPU cores together", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(50, 172, 45, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 85 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 95 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 0, + "y": 1 + }, + "id": 20, + "links": [], + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "(sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode!=\"idle\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))) * 100", + "hide": false, + "intervalFactor": 1, + "legendFormat": "", + "range": true, + "refId": "A", + "step": 240 + } + ], + "title": "CPU Busy", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Busy state of all CPU cores together (5 min average)", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(50, 172, 45, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 85 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 95 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 3, + "y": 1 + }, + "id": 155, + "links": [], + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "avg(node_load5{instance=\"$node\",job=\"$job\"}) / count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)) * 100", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "title": "Sys Load (5m avg)", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Busy state of all CPU cores together (15 min average)", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(50, 172, 45, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 85 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 95 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 6, + "y": 1 + }, + "id": 19, + "links": [], + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "avg(node_load15{instance=\"$node\",job=\"$job\"}) / count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu)) * 100", + "hide": false, + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "title": "Sys Load (15m avg)", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Non available RAM memory", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(50, 172, 45, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 80 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 90 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 9, + "y": 1 + }, + "hideTimeOverride": false, + "id": 16, + "links": [], + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "((node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}) / (node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} )) * 100", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "100 - ((node_memory_MemAvailable_bytes{instance=\"$node\",job=\"$job\"} * 100) / node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"})", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "refId": "B", + "step": 240 + } + ], + "title": "RAM Used", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Used Swap", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(50, 172, 45, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 10 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 25 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 12, + "y": 1 + }, + "id": 21, + "links": [], + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "((node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"}) / (node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} )) * 100", + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "title": "SWAP Used", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Used Root FS", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(50, 172, 45, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 80 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 90 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 4, + "w": 3, + "x": 15, + "y": 1 + }, + "id": 154, + "links": [], + "options": { + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showThresholdLabels": false, + "showThresholdMarkers": true + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "100 - ((node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"} * 100) / node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"})", + "format": "time_series", + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "title": "Root FS Used", + "type": "gauge" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Total number of CPU cores", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 18, + "y": 1 + }, + "id": 14, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "count(count(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}) by (cpu))", + "interval": "", + "intervalFactor": 1, + "legendFormat": "", + "refId": "A", + "step": 240 + } + ], + "title": "CPU Cores", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "System uptime", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 1, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 4, + "x": 20, + "y": 1 + }, + "hideTimeOverride": true, + "id": 15, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_time_seconds{instance=\"$node\",job=\"$job\"} - node_boot_time_seconds{instance=\"$node\",job=\"$job\"}", + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "title": "Uptime", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Total RootFS", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(50, 172, 45, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 70 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 90 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 18, + "y": 3 + }, + "id": 23, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",mountpoint=\"/\",fstype!=\"rootfs\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "title": "RootFS Total", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Total RAM", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 20, + "y": 3 + }, + "id": 75, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"}", + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "title": "RAM Total", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Total SWAP", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "decimals": 0, + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 2, + "w": 2, + "x": 22, + "y": 3 + }, + "id": 18, + "links": [], + "maxDataPoints": 100, + "options": { + "colorMode": "none", + "graphMode": "none", + "justifyMode": "auto", + "orientation": "horizontal", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "9.4.3", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"}", + "intervalFactor": 1, + "refId": "A", + "step": 240 + } + ], + "title": "SWAP Total", + "type": "stat" + }, + { + "collapsed": false, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 5 + }, + "id": 263, + "panels": [], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Basic CPU / Mem / Net / Disk", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Basic CPU info", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "percent" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Busy Iowait" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Idle" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy Iowait" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Idle" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy System" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy User" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Busy Other" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 6 + }, + "id": 77, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true, + "width": 250 + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"system\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Busy System", + "range": true, + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"user\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Busy User", + "range": true, + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"iowait\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Busy Iowait", + "range": true, + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=~\".*irq\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Busy IRQs", + "range": true, + "refId": "D", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode!='idle',mode!='user',mode!='system',mode!='iowait',mode!='irq',mode!='softirq'}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Busy Other", + "range": true, + "refId": "E", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"idle\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Idle", + "range": true, + "refId": "F", + "step": 240 + } + ], + "title": "CPU Basic", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Basic memory usage", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "SWAP Used" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap Used" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + }, + { + "id": "custom.stacking", + "value": { + "group": false, + "mode": "normal" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM Cache + Buffer" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Available" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#DEDAF7", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + }, + { + "id": "custom.stacking", + "value": { + "group": false, + "mode": "normal" + } + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 6 + }, + "id": 78, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "RAM Total", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"} - (node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} + node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"})", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "RAM Used", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} + node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} + node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "RAM Cache + Buffer", + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "RAM Free", + "refId": "D", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "(node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "SWAP Used", + "refId": "E", + "step": 240 + } + ], + "title": "Memory Basic", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Basic network info per interface", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bps" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Recv_bytes_eth2" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Recv_bytes_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Recv_drop_eth2" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Recv_drop_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Recv_errs_eth2" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Recv_errs_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CCA300", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Trans_bytes_eth2" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Trans_bytes_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Trans_drop_eth2" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Trans_drop_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Trans_errs_eth2" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Trans_errs_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CCA300", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "recv_bytes_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "recv_drop_eth0" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "recv_drop_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#967302", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "recv_errs_eth0" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "recv_errs_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "trans_bytes_eth0" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "trans_bytes_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "trans_drop_eth0" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "trans_drop_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#967302", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "trans_errs_eth0" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "trans_errs_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 0, + "y": 13 + }, + "id": 74, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_receive_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "recv {{device}}", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_transmit_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "trans {{device}} ", + "refId": "B", + "step": 240 + } + ], + "title": "Network Traffic Basic", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Disk space used of all filesystems mounted", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 12, + "x": 12, + "y": 13 + }, + "id": 152, + "links": [], + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "100 - ((node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'} * 100) / node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{mountpoint}}", + "refId": "A", + "step": 240 + } + ], + "title": "Disk Space Used Basic", + "type": "timeseries" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 265, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "percentage", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 70, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "percent" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Idle - Waiting for something to happen" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Iowait - Waiting for I/O to complete" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Irq - Servicing interrupts" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Nice - Niced processes executing in user mode" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Softirq - Servicing softirqs" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Steal - Time spent in other operating systems when running in a virtualized environment" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCE2DE", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "System - Processes executing in kernel mode" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "User - Normal processes executing in user mode" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#5195CE", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 7 + }, + "id": 3, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 250 + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"system\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "System - Processes executing in kernel mode", + "range": true, + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"user\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "User - Normal processes executing in user mode", + "range": true, + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"nice\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Nice - Niced processes executing in user mode", + "range": true, + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"iowait\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Iowait - Waiting for I/O to complete", + "range": true, + "refId": "E", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"irq\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Irq - Servicing interrupts", + "range": true, + "refId": "F", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"softirq\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Softirq - Servicing softirqs", + "range": true, + "refId": "G", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"steal\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Steal - Time spent in other operating systems when running in a virtualized environment", + "range": true, + "refId": "H", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\", mode=\"idle\"}[$__rate_interval])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])))", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Idle - Waiting for something to happen", + "range": true, + "refId": "J", + "step": 240 + } + ], + "title": "CPU", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap - Swap memory usage" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused - Free memory unassigned" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*Hardware Corrupted - *./" + }, + "properties": [ + { + "id": "custom.stacking", + "value": { + "group": false, + "mode": "normal" + } + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 7 + }, + "id": 24, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_MemTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"} - node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"} - node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"} - node_memory_Slab_bytes{instance=\"$node\",job=\"$job\"} - node_memory_PageTables_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapCached_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Apps - Memory used by user-space applications", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_PageTables_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "PageTables - Memory used to map between virtual and physical memory addresses", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_SwapCached_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "SwapCache - Memory that keeps track of pages that have been fetched from swap but not yet been modified", + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Slab_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Slab - Memory used by the kernel to cache data structures for its own use (caches like inode, dentry, etc)", + "refId": "D", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Cached_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Cache - Parked file data (file content) cache", + "refId": "E", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Buffers_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Buffers - Block device (e.g. harddisk) cache", + "refId": "F", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_MemFree_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Unused - Free memory unassigned", + "refId": "G", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "(node_memory_SwapTotal_bytes{instance=\"$node\",job=\"$job\"} - node_memory_SwapFree_bytes{instance=\"$node\",job=\"$job\"})", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Swap - Swap space used", + "refId": "H", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_HardwareCorrupted_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working", + "refId": "I", + "step": 240 + } + ], + "title": "Memory Stack", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bits out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bps" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "receive_packets_eth0" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "receive_packets_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "transmit_packets_eth0" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "transmit_packets_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*Trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 19 + }, + "id": 84, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_receive_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Receive", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_transmit_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])*8", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Transmit", + "refId": "B", + "step": 240 + } + ], + "title": "Network Traffic", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 19 + }, + "id": 156, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'} - node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{mountpoint}}", + "refId": "A", + "step": 240 + } + ], + "title": "Disk Space Used", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "IO read (-) / write (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "iops" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Read.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda2_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BA43A9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda3_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F4D598", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#962D82", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#9AC48A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#65C5DB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9934E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCEACA", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9E2D2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 31 + }, + "id": 229, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_reads_completed_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"}[$__rate_interval])", + "intervalFactor": 4, + "legendFormat": "{{device}} - Reads completed", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_writes_completed_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"}[$__rate_interval])", + "intervalFactor": 1, + "legendFormat": "{{device}} - Writes completed", + "refId": "B", + "step": 240 + } + ], + "title": "Disk IOps", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes read (-) / write (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "io time" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*read*./" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byType", + "options": "time" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "hidden" + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 31 + }, + "id": 42, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_read_bytes_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{device}} - Successfully read bytes", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_written_bytes_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{device}} - Successfully written bytes", + "refId": "B", + "step": 240 + } + ], + "title": "I/O Usage Read / Write", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "%util", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 40, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "io time" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byType", + "options": "time" + }, + "properties": [ + { + "id": "custom.axisPlacement", + "value": "hidden" + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 0, + "y": 43 + }, + "id": 127, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_io_time_seconds_total{instance=\"$node\",job=\"$job\",device=~\"$diskdevices\"} [$__rate_interval])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{device}}", + "refId": "A", + "step": 240 + } + ], + "title": "I/O Utilization", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "percentage", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "bars", + "fillOpacity": 70, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "smooth", + "lineWidth": 2, + "pointSize": 3, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "max": 1, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/^Guest - /" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#5195ce", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/^GuestNice - /" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#c15c17", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 12, + "x": 12, + "y": 43 + }, + "id": 319, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_guest_seconds_total{instance=\"$node\",job=\"$job\", mode=\"user\"}[1m])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[1m])))", + "hide": false, + "legendFormat": "Guest - Time spent running a virtual CPU for a guest operating system", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum by(instance) (irate(node_cpu_guest_seconds_total{instance=\"$node\",job=\"$job\", mode=\"nice\"}[1m])) / on(instance) group_left sum by (instance)((irate(node_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[1m])))", + "hide": false, + "legendFormat": "GuestNice - Time spent running a niced guest (virtual CPU for guest operating system)", + "range": true, + "refId": "B" + } + ], + "title": "CPU spent seconds in guests (VMs)", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "CPU / Memory / Net / Disk", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 21 + }, + "id": 266, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 38 + }, + "id": 136, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Inactive_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Inactive - Memory which has been less recently used. It is more eligible to be reclaimed for other purposes", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Active_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Active - Memory that has been used more recently and usually not reclaimed unless absolutely necessary", + "refId": "B", + "step": 240 + } + ], + "title": "Memory Active / Inactive", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*CommitLimit - *./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 38 + }, + "id": 135, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Committed_AS_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Committed_AS - Amount of memory presently allocated on the system", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_CommitLimit_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "CommitLimit - Amount of memory currently available to be allocated on the system", + "refId": "B", + "step": 240 + } + ], + "title": "Memory Committed", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 48 + }, + "id": 191, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Inactive_file_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Inactive_file - File-backed memory on inactive LRU list", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Inactive_anon_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Inactive_anon - Anonymous and swap cache on inactive LRU list, including tmpfs (shmem)", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Active_file_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Active_file - File-backed memory on active LRU list", + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Active_anon_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Active_anon - Anonymous and swap cache on active least-recently-used (LRU) list, including tmpfs", + "refId": "D", + "step": 240 + } + ], + "title": "Memory Active / Inactive Detail", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#58140C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Dirty" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#B7DBAB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mapped" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM + Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VmallocUsed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 48 + }, + "id": 130, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Writeback_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Writeback - Memory which is actively being written back to disk", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_WritebackTmp_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "WritebackTmp - Memory used by FUSE for temporary writeback buffers", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Dirty_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Dirty - Memory which is waiting to get written back to the disk", + "refId": "C", + "step": 240 + } + ], + "title": "Memory Writeback and Dirty", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "ShmemHugePages - Memory used by shared memory (shmem) and tmpfs allocated with huge pages" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "ShmemHugePages - Memory used by shared memory (shmem) and tmpfs allocated with huge pages" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 58 + }, + "id": 138, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Mapped_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Mapped - Used memory in mapped pages files which have been mapped, such as libraries", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Shmem_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Shmem - Used shared memory (shared between several processes, thus including RAM disks)", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_ShmemHugePages_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "ShmemHugePages - Memory used by shared memory (shmem) and tmpfs allocated with huge pages", + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_ShmemPmdMapped_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "ShmemPmdMapped - Amount of shared (shmem/tmpfs) memory backed by huge pages", + "refId": "D", + "step": 240 + } + ], + "title": "Memory Shared and Mapped", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#58140C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Dirty" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#B7DBAB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mapped" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM + Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VmallocUsed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 58 + }, + "id": 131, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_SUnreclaim_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "SUnreclaim - Part of Slab, that cannot be reclaimed on memory pressure", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_SReclaimable_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "SReclaimable - Part of Slab, that might be reclaimed, such as caches", + "refId": "B", + "step": 240 + } + ], + "title": "Memory Slab", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#58140C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Dirty" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#B7DBAB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mapped" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM + Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VmallocUsed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 68 + }, + "id": 70, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_VmallocChunk_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "VmallocChunk - Largest contiguous block of vmalloc area which is free", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_VmallocTotal_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "VmallocTotal - Total size of vmalloc memory area", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_VmallocUsed_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "VmallocUsed - Amount of vmalloc area which is used", + "refId": "C", + "step": 240 + } + ], + "title": "Memory Vmalloc", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 68 + }, + "id": 159, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Bounce_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Bounce - Memory used for block device bounce buffers", + "refId": "A", + "step": 240 + } + ], + "title": "Memory Bounce", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#58140C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Dirty" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#B7DBAB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mapped" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM + Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VmallocUsed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*Inactive *./" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 78 + }, + "id": 129, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_AnonHugePages_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "AnonHugePages - Memory in anonymous huge pages", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_AnonPages_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "AnonPages - Memory in user pages not backed by files", + "refId": "B", + "step": 240 + } + ], + "title": "Memory Anonymous", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 78 + }, + "id": 160, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_KernelStack_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "KernelStack - Kernel memory stack. This is not reclaimable", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Percpu_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "PerCPU - Per CPU memory allocated dynamically by loadable modules", + "refId": "B", + "step": 240 + } + ], + "title": "Memory Kernel / CPU", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "pages", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#58140C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Dirty" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#B7DBAB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mapped" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM + Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VmallocUsed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 88 + }, + "id": 140, + "links": [], + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_HugePages_Free{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "HugePages_Free - Huge pages in the pool that are not yet allocated", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_HugePages_Rsvd{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "HugePages_Rsvd - Huge pages for which a commitment to allocate from the pool has been made, but no allocation has yet been made", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_HugePages_Surp{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "HugePages_Surp - Huge pages in the pool above the value in /proc/sys/vm/nr_hugepages", + "refId": "C", + "step": 240 + } + ], + "title": "Memory HugePages Counter", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#58140C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Dirty" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#B7DBAB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mapped" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM + Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VmallocUsed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 88 + }, + "id": 71, + "links": [], + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_HugePages_Total{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "HugePages - Total size of the pool of huge pages", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Hugepagesize_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Hugepagesize - Huge Page size", + "refId": "B", + "step": 240 + } + ], + "title": "Memory HugePages Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#58140C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Dirty" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#B7DBAB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mapped" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM + Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VmallocUsed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 98 + }, + "id": 128, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_DirectMap1G_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "DirectMap1G - Amount of pages mapped as this size", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_DirectMap2M_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "DirectMap2M - Amount of pages mapped as this size", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_DirectMap4k_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "DirectMap4K - Amount of pages mapped as this size", + "refId": "C", + "step": 240 + } + ], + "title": "Memory DirectMap", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 98 + }, + "id": 137, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Unevictable_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Unevictable - Amount of unevictable memory that can't be swapped out for a variety of reasons", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_Mlocked_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "MLocked - Size of pages locked to memory using the mlock() system call", + "refId": "B", + "step": 240 + } + ], + "title": "Memory Unevictable and MLocked", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#58140C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Dirty" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#B7DBAB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mapped" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM + Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VmallocUsed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 108 + }, + "id": 132, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_memory_NFS_Unstable_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "NFS Unstable - Memory in NFS pages sent to the server, but not yet committed to the storage", + "refId": "A", + "step": 240 + } + ], + "title": "Memory NFS", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Memory Meminfo", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 22 + }, + "id": 267, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "pages out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*out/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 25 + }, + "id": 176, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_vmstat_pgpgin{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pagesin - Page in operations", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_vmstat_pgpgout{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pagesout - Page out operations", + "refId": "B", + "step": 240 + } + ], + "title": "Memory Pages In / Out", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "pages out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*out/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 25 + }, + "id": 22, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_vmstat_pswpin{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pswpin - Pages swapped in", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_vmstat_pswpout{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pswpout - Pages swapped out", + "refId": "B", + "step": 240 + } + ], + "title": "Memory Pages Swap In / Out", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "faults", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Apps" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#629E51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A437C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Hardware Corrupted - Amount of RAM that the kernel identified as corrupted / not working" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#CFFAFF", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "RAM_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#806EB7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#2F575E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Unused" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Pgfault - Page major and minor fault operations" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 0 + }, + { + "id": "custom.stacking", + "value": { + "group": false, + "mode": "normal" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 35 + }, + "id": 175, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 350 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_vmstat_pgfault{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pgfault - Page major and minor fault operations", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_vmstat_pgmajfault{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pgmajfault - Major page fault operations", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_vmstat_pgfault{instance=\"$node\",job=\"$job\"}[$__rate_interval]) - irate(node_vmstat_pgmajfault{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Pgminfault - Minor page fault operations", + "refId": "C", + "step": 240 + } + ], + "title": "Memory Page Faults", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#99440A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Buffers" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#58140C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6D1F62", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Cached" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Committed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#508642", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Dirty" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Free" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#B7DBAB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Mapped" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "PageTables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Page_Tables" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Slab_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Swap_Cache" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C15C17", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#511749", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total RAM + Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#052B51", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Total Swap" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "VmallocUsed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 35 + }, + "id": 307, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_vmstat_oom_kill{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "oom killer invocations ", + "refId": "A", + "step": 240 + } + ], + "title": "OOM Killer", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Memory Vmstat", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 23 + }, + "id": 293, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "seconds", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Variation*./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 40 + }, + "id": 260, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_timex_estimated_error_seconds{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "Estimated error in seconds", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_timex_offset_seconds{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "Time offset in between local system and reference clock", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_timex_maxerror_seconds{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "Maximum error in seconds", + "refId": "C", + "step": 240 + } + ], + "title": "Time Synchronized Drift", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 40 + }, + "id": 291, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_timex_loop_time_constant{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Phase-locked loop time adjust", + "refId": "A", + "step": 240 + } + ], + "title": "Time PLL Adjust", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Variation*./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 50 + }, + "id": 168, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_timex_sync_status{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Is clock synchronized to a reliable server (1 = yes, 0 = no)", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_timex_frequency_adjustment_ratio{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Local clock frequency adjustment", + "refId": "B", + "step": 240 + } + ], + "title": "Time Synchronized Status", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "seconds", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 50 + }, + "id": 294, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_timex_tick_seconds{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Seconds between clock ticks", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_timex_tai_offset_seconds{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "International Atomic Time (TAI) offset", + "refId": "B", + "step": 240 + } + ], + "title": "Time Misc", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "System Timesync", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 24 + }, + "id": 312, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 27 + }, + "id": 62, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_procs_blocked{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Processes blocked waiting for I/O to complete", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_procs_running{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Processes in runnable state", + "refId": "B", + "step": 240 + } + ], + "title": "Processes Status", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 27 + }, + "id": 315, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_processes_state{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ state }}", + "refId": "A", + "step": 240 + } + ], + "title": "Processes State", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "forks / sec", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 37 + }, + "id": 148, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_forks_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Processes forks second", + "refId": "A", + "step": 240 + } + ], + "title": "Processes Forks", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "decbytes" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Max.*/" + }, + "properties": [ + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 37 + }, + "id": 149, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(process_virtual_memory_bytes{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "Processes virtual memory size in bytes", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "process_resident_memory_max_bytes{instance=\"$node\",job=\"$job\"}", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "Maximum amount of virtual memory available in bytes", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(process_virtual_memory_bytes{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "Processes virtual memory size in bytes", + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(process_virtual_memory_max_bytes{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "Maximum amount of virtual memory available in bytes", + "refId": "D", + "step": 240 + } + ], + "title": "Processes Memory", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "PIDs limit" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F2495C", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 47 + }, + "id": 313, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_processes_pids{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Number of PIDs", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_processes_max_processes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "PIDs limit", + "refId": "B", + "step": 240 + } + ], + "title": "PIDs Number and Limit", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "seconds", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*waiting.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 47 + }, + "id": 305, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_schedstat_running_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "CPU {{ cpu }} - seconds spent running a process", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_schedstat_waiting_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "CPU {{ cpu }} - seconds spent by processing waiting for this CPU", + "refId": "B", + "step": 240 + } + ], + "title": "Process schedule stats Running / Waiting", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Threads limit" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F2495C", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 57 + }, + "id": 314, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_processes_threads{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Allocated threads", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_processes_max_threads{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Threads limit", + "refId": "B", + "step": 240 + } + ], + "title": "Threads Number and Limit", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "System Processes", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 25 + }, + "id": 269, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 42 + }, + "id": 8, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_context_switches_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Context switches", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_intr_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "Interrupts", + "refId": "B", + "step": 240 + } + ], + "title": "Context Switches / Interrupts", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 42 + }, + "id": 7, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_load1{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 4, + "legendFormat": "Load 1m", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_load5{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 4, + "legendFormat": "Load 5m", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_load15{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 4, + "legendFormat": "Load 15m", + "refId": "C", + "step": 240 + } + ], + "title": "System Load", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Critical*./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*Max*./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 52 + }, + "id": 259, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_interrupts_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ type }} - {{ info }}", + "refId": "A", + "step": 240 + } + ], + "title": "Interrupts Detail", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 52 + }, + "id": 306, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_schedstat_timeslices_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "CPU {{ cpu }}", + "refId": "A", + "step": 240 + } + ], + "title": "Schedule timeslices executed by each cpu", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 62 + }, + "id": 151, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_entropy_available_bits{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Entropy available to random number generators", + "refId": "A", + "step": 240 + } + ], + "title": "Entropy", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "seconds", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 62 + }, + "id": 308, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(process_cpu_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Time spent", + "refId": "A", + "step": 240 + } + ], + "title": "CPU time spent in user and system contexts", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Max*./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 72 + }, + "id": 64, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "process_max_fds{instance=\"$node\",job=\"$job\"}", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Maximum open file descriptors", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "process_open_fds{instance=\"$node\",job=\"$job\"}", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Open file descriptors", + "refId": "B", + "step": 240 + } + ], + "title": "File Descriptors", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "System Misc", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 26 + }, + "id": 304, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "temperature", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "celsius" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Critical*./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*Max*./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 43 + }, + "id": 158, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_hwmon_temp_celsius{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ chip }} {{ sensor }} temp", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_hwmon_temp_crit_alarm_celsius{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ chip }} {{ sensor }} Critical Alarm", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_hwmon_temp_crit_celsius{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ chip }} {{ sensor }} Critical", + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_hwmon_temp_crit_hyst_celsius{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ chip }} {{ sensor }} Critical Historical", + "refId": "D", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_hwmon_temp_max_celsius{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ chip }} {{ sensor }} Max", + "refId": "E", + "step": 240 + } + ], + "title": "Hardware temperature monitor", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Max*./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 43 + }, + "id": 300, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_cooling_device_cur_state{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "Current {{ name }} in {{ type }}", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_cooling_device_max_state{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Max {{ name }} in {{ type }}", + "refId": "B", + "step": 240 + } + ], + "title": "Throttle cooling device", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 53 + }, + "id": 302, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_power_supply_online{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ power_supply }} online", + "refId": "A", + "step": 240 + } + ], + "title": "Power supply", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Hardware Misc", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 27 + }, + "id": 296, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 30 + }, + "id": 297, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_systemd_socket_accepted_connections_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{ name }} Connections", + "refId": "A", + "step": 240 + } + ], + "title": "Systemd Sockets", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Failed" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F2495C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Inactive" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FF9830", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Active" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#73BF69", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Deactivating" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FFCB7D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Activating" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#C8F2C2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 30 + }, + "id": 298, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"activating\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Activating", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"active\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Active", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"deactivating\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Deactivating", + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"failed\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Failed", + "refId": "D", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_systemd_units{instance=\"$node\",job=\"$job\",state=\"inactive\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Inactive", + "refId": "E", + "step": 240 + } + ], + "title": "Systemd Units State", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Systemd", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 28 + }, + "id": 270, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "The number (after merges) of I/O requests completed per second for the device", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "IO read (-) / write (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "iops" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Read.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda2_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BA43A9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda3_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F4D598", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#962D82", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#9AC48A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#65C5DB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9934E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCEACA", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9E2D2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 31 + }, + "id": 9, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_reads_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "intervalFactor": 4, + "legendFormat": "{{device}} - Reads completed", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_writes_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "intervalFactor": 1, + "legendFormat": "{{device}} - Writes completed", + "refId": "B", + "step": 240 + } + ], + "title": "Disk IOps Completed", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "The number of bytes read from or written to the device per second", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes read (-) / write (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "Bps" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Read.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda2_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BA43A9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda3_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F4D598", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#962D82", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#9AC48A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#65C5DB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9934E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCEACA", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9E2D2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 31 + }, + "id": 33, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_read_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 4, + "legendFormat": "{{device}} - Read bytes", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_written_bytes_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Written bytes", + "refId": "B", + "step": 240 + } + ], + "title": "Disk R/W Data", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "The average time for requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "time. read (-) / write (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 30, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Read.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda2_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BA43A9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda3_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F4D598", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#962D82", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#9AC48A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#65C5DB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9934E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCEACA", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9E2D2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 41 + }, + "id": 37, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_read_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) / irate(node_disk_reads_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "hide": false, + "interval": "", + "intervalFactor": 4, + "legendFormat": "{{device}} - Read wait time avg", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_write_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval]) / irate(node_disk_writes_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{device}} - Write wait time avg", + "refId": "B", + "step": 240 + } + ], + "title": "Disk Average Wait Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "The average queue length of the requests that were issued to the device", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "aqu-sz", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda2_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BA43A9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda3_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F4D598", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#962D82", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#9AC48A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#65C5DB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9934E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCEACA", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9E2D2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 41 + }, + "id": 35, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_io_time_weighted_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "interval": "", + "intervalFactor": 4, + "legendFormat": "{{device}}", + "refId": "A", + "step": 240 + } + ], + "title": "Average Queue Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "The number of read and write requests merged per second that were queued to the device", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "I/Os", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "iops" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Read.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda2_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BA43A9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda3_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F4D598", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#962D82", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#9AC48A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#65C5DB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9934E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCEACA", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9E2D2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 51 + }, + "id": 133, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_reads_merged_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "intervalFactor": 1, + "legendFormat": "{{device}} - Read merged", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_writes_merged_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "intervalFactor": 1, + "legendFormat": "{{device}} - Write merged", + "refId": "B", + "step": 240 + } + ], + "title": "Disk R/W Merged", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Percentage of elapsed time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100% for devices serving requests serially. But for devices serving requests in parallel, such as RAID arrays and modern SSDs, this number does not reflect their performance limits.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "%util", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 30, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda2_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BA43A9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda3_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F4D598", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#962D82", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#9AC48A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#65C5DB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9934E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCEACA", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9E2D2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 51 + }, + "id": 36, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_io_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "interval": "", + "intervalFactor": 4, + "legendFormat": "{{device}} - IO", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_discard_time_seconds_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "interval": "", + "intervalFactor": 4, + "legendFormat": "{{device}} - discard", + "refId": "B", + "step": 240 + } + ], + "title": "Time Spent Doing I/Os", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "The number of outstanding requests at the instant the sample was taken. Incremented as requests are given to appropriate struct request_queue and decremented as they finish.", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Outstanding req.", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda2_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BA43A9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda3_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F4D598", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#962D82", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#9AC48A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#65C5DB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9934E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCEACA", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9E2D2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 61 + }, + "id": 34, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_disk_io_now{instance=\"$node\",job=\"$job\"}", + "interval": "", + "intervalFactor": 4, + "legendFormat": "{{device}} - IO now", + "refId": "A", + "step": 240 + } + ], + "title": "Instantaneous Queue Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "IOs", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "iops" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EAB839", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#6ED0E0", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EF843C", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#584477", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda2_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BA43A9", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sda3_.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F4D598", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#0A50A1", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#BF1B00", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdb3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0752D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#962D82", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#614D93", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdc3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#9AC48A", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#65C5DB", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9934E", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#EA6460", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde1.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E0F9D7", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sdd2.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#FCEACA", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*sde3.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F9E2D2", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 61 + }, + "id": 301, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_discards_completed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "interval": "", + "intervalFactor": 4, + "legendFormat": "{{device}} - Discards completed", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_disk_discards_merged_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{device}} - Discards merged", + "refId": "B", + "step": 240 + } + ], + "title": "Disk IOps Discards completed / merged", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Storage Disk", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 29 + }, + "id": 271, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 46 + }, + "id": 43, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filesystem_avail_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{mountpoint}} - Available", + "metric": "", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filesystem_free_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'}", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "{{mountpoint}} - Free", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filesystem_size_bytes{instance=\"$node\",job=\"$job\",device!~'rootfs'}", + "format": "time_series", + "hide": true, + "intervalFactor": 1, + "legendFormat": "{{mountpoint}} - Size", + "refId": "C", + "step": 240 + } + ], + "title": "Filesystem space available", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "file nodes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 46 + }, + "id": 41, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filesystem_files_free{instance=\"$node\",job=\"$job\",device!~'rootfs'}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{mountpoint}} - Free file nodes", + "refId": "A", + "step": 240 + } + ], + "title": "File Nodes Free", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "files", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 56 + }, + "id": 28, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filefd_maximum{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 4, + "legendFormat": "Max open files", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filefd_allocated{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "Open files", + "refId": "B", + "step": 240 + } + ], + "title": "File Descriptor", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "file Nodes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 56 + }, + "id": 219, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filesystem_files{instance=\"$node\",job=\"$job\",device!~'rootfs'}", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{mountpoint}} - File nodes total", + "refId": "A", + "step": 240 + } + ], + "title": "File Nodes Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "max": 1, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "/ ReadOnly" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 66 + }, + "id": 44, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filesystem_readonly{instance=\"$node\",job=\"$job\",device!~'rootfs'}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{mountpoint}} - ReadOnly", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_filesystem_device_error{instance=\"$node\",job=\"$job\",device!~'rootfs',fstype!~'tmpfs'}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{mountpoint}} - Device error", + "refId": "B", + "step": 240 + } + ], + "title": "Filesystem in ReadOnly / Error", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Storage Filesystem", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 30 + }, + "id": 272, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "packets out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "receive_packets_eth0" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "receive_packets_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "transmit_packets_eth0" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#7EB26D", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "transmit_packets_lo" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#E24D42", + "mode": "fixed" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*Trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 31 + }, + "id": 60, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_receive_packets_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{device}} - Receive", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_transmit_packets_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{device}} - Transmit", + "refId": "B", + "step": 240 + } + ], + "title": "Network Traffic by Packets", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "packets out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 31 + }, + "id": 142, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_receive_errs_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Receive errors", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_transmit_errs_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Rransmit errors", + "refId": "B", + "step": 240 + } + ], + "title": "Network Traffic Errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "packets out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 41 + }, + "id": 143, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_receive_drop_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Receive drop", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_transmit_drop_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Transmit drop", + "refId": "B", + "step": 240 + } + ], + "title": "Network Traffic Drop", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "packets out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 41 + }, + "id": 141, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_receive_compressed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Receive compressed", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_transmit_compressed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Transmit compressed", + "refId": "B", + "step": 240 + } + ], + "title": "Network Traffic Compressed", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "packets out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 51 + }, + "id": 146, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_receive_multicast_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Receive multicast", + "refId": "A", + "step": 240 + } + ], + "title": "Network Traffic Multicast", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "packets out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 51 + }, + "id": 144, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_receive_fifo_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Receive fifo", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_transmit_fifo_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Transmit fifo", + "refId": "B", + "step": 240 + } + ], + "title": "Network Traffic Fifo", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "packets out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "pps" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 61 + }, + "id": 145, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_receive_frame_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "intervalFactor": 1, + "legendFormat": "{{device}} - Receive frame", + "refId": "A", + "step": 240 + } + ], + "title": "Network Traffic Frame", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 61 + }, + "id": 231, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_transmit_carrier_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Statistic transmit_carrier", + "refId": "A", + "step": 240 + } + ], + "title": "Network Traffic Carrier", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Trans.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 71 + }, + "id": 232, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_network_transmit_colls_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{device}} - Transmit colls", + "refId": "A", + "step": 240 + } + ], + "title": "Network Traffic Colls", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "entries", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "NF conntrack limit" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 71 + }, + "id": 61, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_nf_conntrack_entries{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "NF conntrack entries", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_nf_conntrack_entries_limit{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "NF conntrack limit", + "refId": "B", + "step": 240 + } + ], + "title": "NF Contrack", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "Entries", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 81 + }, + "id": 230, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_arp_entries{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ device }} - ARP entries", + "refId": "A", + "step": 240 + } + ], + "title": "ARP Entries", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 81 + }, + "id": 288, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_network_mtu_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ device }} - Bytes", + "refId": "A", + "step": 240 + } + ], + "title": "MTU", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 91 + }, + "id": 280, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_network_speed_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ device }} - Speed", + "refId": "A", + "step": 240 + } + ], + "title": "Speed", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "packets", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "decimals": 0, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 91 + }, + "id": 289, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_network_transmit_queue_length{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{ device }} - Interface transmit queue length", + "refId": "A", + "step": 240 + } + ], + "title": "Queue Length", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "packetes drop (-) / process (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Dropped.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 101 + }, + "id": 290, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_softnet_processed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "CPU {{cpu}} - Processed", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_softnet_dropped_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "CPU {{cpu}} - Dropped", + "refId": "B", + "step": 240 + } + ], + "title": "Softnet Packets", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 101 + }, + "id": 310, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_softnet_times_squeezed_total{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "CPU {{cpu}} - Squeezed", + "refId": "A", + "step": 240 + } + ], + "title": "Softnet Out of Quota", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 111 + }, + "id": 309, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_network_up{operstate=\"up\",instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{interface}} - Operational state UP", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_network_carrier{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "instant": false, + "legendFormat": "{{device}} - Physical link state", + "refId": "B" + } + ], + "title": "Network Operational Status", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Network Traffic", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 31 + }, + "id": 273, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 32 + }, + "id": 63, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_TCP_alloc{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "TCP_alloc - Allocated sockets", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_TCP_inuse{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "TCP_inuse - Tcp sockets currently in use", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_TCP_mem{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": true, + "interval": "", + "intervalFactor": 1, + "legendFormat": "TCP_mem - Used memory for tcp", + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_TCP_orphan{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "TCP_orphan - Orphan sockets", + "refId": "D", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_TCP_tw{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "TCP_tw - Sockets waiting close", + "refId": "E", + "step": 240 + } + ], + "title": "Sockstat TCP", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 32 + }, + "id": 124, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_UDPLITE_inuse{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "UDPLITE_inuse - Udplite sockets currently in use", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_UDP_inuse{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "UDP_inuse - Udp sockets currently in use", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_UDP_mem{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "UDP_mem - Used memory for udp", + "refId": "C", + "step": 240 + } + ], + "title": "Sockstat UDP", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 42 + }, + "id": 125, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_FRAG_inuse{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "FRAG_inuse - Frag sockets currently in use", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_RAW_inuse{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "RAW_inuse - Raw sockets currently in use", + "refId": "C", + "step": 240 + } + ], + "title": "Sockstat FRAG / RAW", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "bytes", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "bytes" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 42 + }, + "id": 220, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_TCP_mem_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "mem_bytes - TCP sockets in that state", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_UDP_mem_bytes{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "mem_bytes - UDP sockets in that state", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_FRAG_memory{instance=\"$node\",job=\"$job\"}", + "interval": "", + "intervalFactor": 1, + "legendFormat": "FRAG_memory - Used memory for frag", + "refId": "C" + } + ], + "title": "Sockstat Memory Size", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "sockets", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 52 + }, + "id": 126, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_sockstat_sockets_used{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Sockets_used - Sockets currently in use", + "refId": "A", + "step": 240 + } + ], + "title": "Sockstat Used", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Network Sockstat", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 32 + }, + "id": 274, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "octets out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Out.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 33 + }, + "id": 221, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_IpExt_InOctets{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "InOctets - Received octets", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_IpExt_OutOctets{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "OutOctets - Sent octets", + "refId": "B", + "step": 240 + } + ], + "title": "Netstat IP In / Out Octets", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "datagrams", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 33 + }, + "id": 81, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true, + "width": 300 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Ip_Forwarding{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "Forwarding - IP forwarding", + "refId": "A", + "step": 240 + } + ], + "title": "Netstat IP Forwarding", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "messages out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Out.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 43 + }, + "id": 115, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Icmp_InMsgs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "InMsgs - Messages which the entity received. Note that this counter includes all those counted by icmpInErrors", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Icmp_OutMsgs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "OutMsgs - Messages which this entity attempted to send. Note that this counter includes all those counted by icmpOutErrors", + "refId": "B", + "step": 240 + } + ], + "title": "ICMP In / Out", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "messages out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Out.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 43 + }, + "id": 50, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Icmp_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "InErrors - Messages which the entity received but determined as having ICMP-specific errors (bad ICMP checksums, bad length, etc.)", + "refId": "A", + "step": 240 + } + ], + "title": "ICMP Errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "datagrams out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Out.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*Snd.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 53 + }, + "id": 55, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Udp_InDatagrams{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "InDatagrams - Datagrams received", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Udp_OutDatagrams{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "OutDatagrams - Datagrams sent", + "refId": "B", + "step": 240 + } + ], + "title": "UDP In / Out", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "datagrams", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 53 + }, + "id": 109, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Udp_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "InErrors - UDP Datagrams that could not be delivered to an application", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Udp_NoPorts{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "NoPorts - UDP Datagrams received on a port with no listener", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_UdpLite_InErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "interval": "", + "legendFormat": "InErrors Lite - UDPLite Datagrams that could not be delivered to an application", + "refId": "C" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Udp_RcvbufErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "RcvbufErrors - UDP buffer errors received", + "refId": "D", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Udp_SndbufErrors{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "SndbufErrors - UDP buffer errors send", + "refId": "E", + "step": 240 + } + ], + "title": "UDP Errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "datagrams out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Out.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": "/.*Snd.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 63 + }, + "id": 299, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Tcp_InSegs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "InSegs - Segments received, including those received in error. This count includes segments received on currently established connections", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Tcp_OutSegs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "OutSegs - Segments sent, including those on current connections but excluding those containing only retransmitted octets", + "refId": "B", + "step": 240 + } + ], + "title": "TCP In / Out", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 63 + }, + "id": 104, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_TcpExt_ListenOverflows{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "ListenOverflows - Times the listen queue of a socket overflowed", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_TcpExt_ListenDrops{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "ListenDrops - SYNs to LISTEN sockets ignored", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_TcpExt_TCPSynRetrans{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "TCPSynRetrans - SYN-SYN/ACK retransmits to break down retransmissions in SYN, fast/timeout retransmits", + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Tcp_RetransSegs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "interval": "", + "legendFormat": "RetransSegs - Segments retransmitted - that is, the number of TCP segments transmitted containing one or more previously transmitted octets", + "refId": "D" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Tcp_InErrs{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "interval": "", + "legendFormat": "InErrs - Segments received in error (e.g., bad TCP checksums)", + "refId": "E" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Tcp_OutRsts{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "interval": "", + "legendFormat": "OutRsts - Segments sent with RST flag", + "refId": "F" + } + ], + "title": "TCP Errors", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "connections", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*MaxConn *./" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#890F02", + "mode": "fixed" + } + }, + { + "id": "custom.fillOpacity", + "value": 0 + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 73 + }, + "id": 85, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_netstat_Tcp_CurrEstab{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "CurrEstab - TCP connections for which the current state is either ESTABLISHED or CLOSE- WAIT", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_netstat_Tcp_MaxConn{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "MaxConn - Limit on the total number of TCP connections the entity can support (Dynamic is \"-1\")", + "refId": "B", + "step": 240 + } + ], + "title": "TCP Connections", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter out (-) / in (+)", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*Sent.*/" + }, + "properties": [ + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 73 + }, + "id": 91, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_TcpExt_SyncookiesFailed{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SyncookiesFailed - Invalid SYN cookies received", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_TcpExt_SyncookiesRecv{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SyncookiesRecv - SYN cookies received", + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_TcpExt_SyncookiesSent{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "SyncookiesSent - SYN cookies sent", + "refId": "C", + "step": 240 + } + ], + "title": "TCP SynCookie", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "connections", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 83 + }, + "id": 82, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Tcp_ActiveOpens{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "ActiveOpens - TCP connections that have made a direct transition to the SYN-SENT state from the CLOSED state", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "irate(node_netstat_Tcp_PassiveOpens{instance=\"$node\",job=\"$job\"}[$__rate_interval])", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "PassiveOpens - TCP connections that have made a direct transition to the SYN-RCVD state from the LISTEN state", + "refId": "B", + "step": 240 + } + ], + "title": "TCP Direct Transition", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "Enable with --collector.tcpstat argument on node-exporter", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "connections", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 83 + }, + "id": 320, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "node_tcp_connection_states{state=\"established\",instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "interval": "", + "intervalFactor": 1, + "legendFormat": "established - TCP sockets in established state", + "range": true, + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "node_tcp_connection_states{state=\"fin_wait2\",instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "fin_wait2 - TCP sockets in fin_wait2 state", + "range": true, + "refId": "B", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "node_tcp_connection_states{state=\"listen\",instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "listen - TCP sockets in listen state", + "range": true, + "refId": "C", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "node_tcp_connection_states{state=\"time_wait\",instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "time_wait - TCP sockets in time_wait state", + "range": true, + "refId": "D", + "step": 240 + } + ], + "title": "TCP Stat", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Network Netstat", + "type": "row" + }, + { + "collapsed": true, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 33 + }, + "id": 279, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "seconds", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "normal" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 0, + "y": 50 + }, + "id": 40, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_scrape_collector_duration_seconds{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{collector}} - Scrape duration", + "refId": "A", + "step": 240 + } + ], + "title": "Node Exporter Scrape Time", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "counter", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 20, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineStyle": { + "fill": "solid" + }, + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "links": [], + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [ + { + "matcher": { + "id": "byRegexp", + "options": "/.*error.*/" + }, + "properties": [ + { + "id": "color", + "value": { + "fixedColor": "#F2495C", + "mode": "fixed" + } + }, + { + "id": "custom.transform", + "value": "negative-Y" + } + ] + } + ] + }, + "gridPos": { + "h": 10, + "w": 12, + "x": 12, + "y": 50 + }, + "id": 157, + "links": [], + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "9.2.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_scrape_collector_success{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{collector}} - Scrape success", + "refId": "A", + "step": 240 + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "expr": "node_textfile_scrape_error{instance=\"$node\",job=\"$job\"}", + "format": "time_series", + "hide": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{collector}} - Scrape textfile error (1 = true)", + "refId": "B", + "step": 240 + } + ], + "title": "Node Exporter Scrape", + "type": "timeseries" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "refId": "A" + } + ], + "title": "Node Exporter", + "type": "row" + } + ], + "refresh": "", + "revision": 1, + "schemaVersion": 38, + "style": "dark", + "tags": [ + "linux" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "default", + "value": "default" + }, + "hide": 0, + "includeAll": false, + "label": "datasource", + "multi": false, + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Job", + "multi": false, + "name": "job", + "options": [], + "query": { + "query": "label_values(node_uname_info, job)", + "refId": "Prometheus-job-Variable-Query" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": {}, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "definition": "label_values(node_uname_info{job=\"$job\"}, instance)", + "hide": 0, + "includeAll": false, + "label": "Host:", + "multi": false, + "name": "node", + "options": [], + "query": { + "query": "label_values(node_uname_info{job=\"$job\"}, instance)", + "refId": "Prometheus-node-Variable-Query" + }, + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+", + "value": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+" + }, + "hide": 2, + "includeAll": false, + "multi": false, + "name": "diskdevices", + "options": [ + { + "selected": true, + "text": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+", + "value": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+" + } + ], + "query": "[a-z]+|nvme[0-9]+n[0-9]+|mmcblk[0-9]+", + "skipUrlSync": false, + "type": "custom" + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Node Exporter Full", + "uid": "rYdddlPWk", + "version": 82, + "weekStart": "" + } \ No newline at end of file diff --git a/specs/iac/import/grafana/snapshot/main.tf b/specs/iac/import/grafana/snapshot/main.tf new file mode 100644 index 0000000..6efb456 --- /dev/null +++ b/specs/iac/import/grafana/snapshot/main.tf @@ -0,0 +1,4 @@ +resource "guance_dashboard" "main" { + name = var.name + manifest = file("${path.module}/manifest.json") +} diff --git a/specs/iac/import/grafana/snapshot/manifest.json b/specs/iac/import/grafana/snapshot/manifest.json new file mode 100644 index 0000000..e020462 --- /dev/null +++ b/specs/iac/import/grafana/snapshot/manifest.json @@ -0,0 +1,6374 @@ +{ + "dashboardBindSet": [], + "dashboardExtend": {}, + "dashboardMapping": [], + "dashboardOwnerType": "node", + "dashboardType": "CUSTOM", + "iconSet": {}, + "main": { + "charts": [ + { + "extend": { + "settings": { + "levels": [ + { + "lineColor": "rgba(50, 172, 45, 0.97)", + "operation": "\u003c=", + "value": [ + 85 + ] + }, + { + "lineColor": "rgba(237, 129, 40, 0.89)", + "operation": "\u003c=", + "value": [ + 95 + ] + }, + { + "lineColor": "rgba(245, 54, 54, 0.9)", + "operation": "\u003c=", + "value": [ + 100 + ] + } + ], + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Busy state of all CPU cores together" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "CPU Busy", + "pos": { + "h": 10, + "w": 3, + "x": 0, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " (\n sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode!=\"idle\"})\n )\n / on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))\n )\n*\n 100", + "type": "promql" + }, + "type": "gauge" + } + ], + "type": "gauge" + }, + { + "extend": { + "settings": { + "levels": [ + { + "lineColor": "rgba(50, 172, 45, 0.97)", + "operation": "\u003c=", + "value": [ + 85 + ] + }, + { + "lineColor": "rgba(237, 129, 40, 0.89)", + "operation": "\u003c=", + "value": [ + 95 + ] + }, + { + "lineColor": "rgba(245, 54, 54, 0.9)", + "operation": "\u003c=", + "value": [ + 100 + ] + } + ], + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Busy state of all CPU cores together (5 min average)" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "Sys Load (5m avg)", + "pos": { + "h": 10, + "w": 3, + "x": 3, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " avg(prom:node_load5{instance=\"#{node}\",job=\"#{job}\"})\n /\n count(count by (cpu) (prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"}))\n*\n 100", + "type": "promql" + }, + "type": "gauge" + } + ], + "type": "gauge" + }, + { + "extend": { + "settings": { + "levels": [ + { + "lineColor": "rgba(50, 172, 45, 0.97)", + "operation": "\u003c=", + "value": [ + 85 + ] + }, + { + "lineColor": "rgba(237, 129, 40, 0.89)", + "operation": "\u003c=", + "value": [ + 95 + ] + }, + { + "lineColor": "rgba(245, 54, 54, 0.9)", + "operation": "\u003c=", + "value": [ + 100 + ] + } + ], + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Busy state of all CPU cores together (15 min average)" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "Sys Load (15m avg)", + "pos": { + "h": 10, + "w": 3, + "x": 6, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " avg(prom:node_load15{instance=\"#{node}\",job=\"#{job}\"})\n /\n count(count by (cpu) (prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"}))\n*\n 100", + "type": "promql" + }, + "type": "gauge" + } + ], + "type": "gauge" + }, + { + "extend": { + "settings": { + "levels": [ + { + "lineColor": "rgba(50, 172, 45, 0.97)", + "operation": "\u003c=", + "value": [ + 80 + ] + }, + { + "lineColor": "rgba(237, 129, 40, 0.89)", + "operation": "\u003c=", + "value": [ + 90 + ] + }, + { + "lineColor": "rgba(245, 54, 54, 0.9)", + "operation": "\u003c=", + "value": [ + 100 + ] + } + ], + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Non available RAM memory" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "RAM Used", + "pos": { + "h": 10, + "w": 3, + "x": 9, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": true, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " (\n (\n prom:node_memory_MemTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_MemFree_bytes{instance=\"#{node}\",job=\"#{job}\"}\n )\n /\n (prom:node_memory_MemTotal_bytes{instance=\"#{node}\",job=\"#{job}\"})\n )\n*\n 100", + "type": "promql" + }, + "type": "gauge" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": " 100\n-\n (\n (prom:node_memory_MemAvailable_bytes{instance=\"#{node}\",job=\"#{job}\"} * 100)\n /\n prom:node_memory_MemTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}\n )", + "type": "promql" + }, + "type": "gauge" + } + ], + "type": "gauge" + }, + { + "extend": { + "settings": { + "levels": [ + { + "lineColor": "rgba(50, 172, 45, 0.97)", + "operation": "\u003c=", + "value": [ + 10 + ] + }, + { + "lineColor": "rgba(237, 129, 40, 0.89)", + "operation": "\u003c=", + "value": [ + 25 + ] + }, + { + "lineColor": "rgba(245, 54, 54, 0.9)", + "operation": "\u003c=", + "value": [ + 100 + ] + } + ], + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Used Swap" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "SWAP Used", + "pos": { + "h": 10, + "w": 3, + "x": 12, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " (\n (\n prom:node_memory_SwapTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_SwapFree_bytes{instance=\"#{node}\",job=\"#{job}\"}\n )\n /\n (prom:node_memory_SwapTotal_bytes{instance=\"#{node}\",job=\"#{job}\"})\n )\n*\n 100", + "type": "promql" + }, + "type": "gauge" + } + ], + "type": "gauge" + }, + { + "extend": { + "settings": { + "levels": [ + { + "lineColor": "rgba(50, 172, 45, 0.97)", + "operation": "\u003c=", + "value": [ + 80 + ] + }, + { + "lineColor": "rgba(237, 129, 40, 0.89)", + "operation": "\u003c=", + "value": [ + 90 + ] + }, + { + "lineColor": "rgba(245, 54, 54, 0.9)", + "operation": "\u003c=", + "value": [ + 100 + ] + } + ], + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Used Root FS" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "Root FS Used", + "pos": { + "h": 10, + "w": 3, + "x": 15, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " 100\n-\n (\n (\n prom:node_filesystem_avail_bytes{fstype!=\"rootfs\",instance=\"#{node}\",job=\"#{job}\",mountpoint=\"/\"}\n *\n 100\n )\n /\n prom:node_filesystem_size_bytes{fstype!=\"rootfs\",instance=\"#{node}\",job=\"#{job}\",mountpoint=\"/\"}\n )", + "type": "promql" + }, + "type": "gauge" + } + ], + "type": "gauge" + }, + { + "extend": { + "settings": { + "bgColor": "", + "compareType": "", + "downsample": "last", + "fixedTime": "", + "fontColor": "", + "isTimeInterval": false, + "lineColor": "#3AB8FF", + "openCompare": false, + "precision": "2", + "showFieldMapping": false, + "showLine": false, + "showLineAxis": false, + "showTitle": true, + "timeInterval": "default", + "titleDesc": "Total number of CPU cores" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "CPU Cores", + "pos": { + "h": 5, + "w": 2, + "x": 18, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "count(count by (cpu) (prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"}))", + "type": "promql" + }, + "type": "singlestat" + } + ], + "type": "singlestat" + }, + { + "extend": { + "settings": { + "bgColor": "", + "compareType": "", + "downsample": "last", + "fixedTime": "", + "fontColor": "", + "isTimeInterval": false, + "lineColor": "#3AB8FF", + "openCompare": false, + "precision": "2", + "showFieldMapping": false, + "showLine": false, + "showLineAxis": false, + "showTitle": true, + "timeInterval": "default", + "titleDesc": "System uptime" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "Uptime", + "pos": { + "h": 5, + "w": 4, + "x": 20, + "y": 1 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " prom:node_time_seconds{instance=\"#{node}\",job=\"#{job}\"}\n-\n prom:node_boot_time_seconds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "singlestat" + } + ], + "type": "singlestat" + }, + { + "extend": { + "settings": { + "bgColor": "", + "compareType": "", + "downsample": "last", + "fixedTime": "", + "fontColor": "", + "isTimeInterval": false, + "lineColor": "#3AB8FF", + "openCompare": false, + "precision": "2", + "showFieldMapping": false, + "showLine": false, + "showLineAxis": false, + "showTitle": true, + "timeInterval": "default", + "titleDesc": "Total RootFS" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "RootFS Total", + "pos": { + "h": 5, + "w": 2, + "x": 18, + "y": 3 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_filesystem_size_bytes{fstype!=\"rootfs\",instance=\"#{node}\",job=\"#{job}\",mountpoint=\"/\"}", + "type": "promql" + }, + "type": "singlestat" + } + ], + "type": "singlestat" + }, + { + "extend": { + "settings": { + "bgColor": "", + "compareType": "", + "downsample": "last", + "fixedTime": "", + "fontColor": "", + "isTimeInterval": false, + "lineColor": "#3AB8FF", + "openCompare": false, + "precision": "2", + "showFieldMapping": false, + "showLine": false, + "showLineAxis": false, + "showTitle": true, + "timeInterval": "default", + "titleDesc": "Total RAM" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "RAM Total", + "pos": { + "h": 5, + "w": 2, + "x": 20, + "y": 3 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_MemTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "singlestat" + } + ], + "type": "singlestat" + }, + { + "extend": { + "settings": { + "bgColor": "", + "compareType": "", + "downsample": "last", + "fixedTime": "", + "fontColor": "", + "isTimeInterval": false, + "lineColor": "#3AB8FF", + "openCompare": false, + "precision": "2", + "showFieldMapping": false, + "showLine": false, + "showLineAxis": false, + "showTitle": true, + "timeInterval": "default", + "titleDesc": "Total SWAP" + } + }, + "group": { + "name": "Quick CPU / Mem / Disk" + }, + "name": "SWAP Total", + "pos": { + "h": 5, + "w": 2, + "x": 22, + "y": 3 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_SwapTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "singlestat" + } + ], + "type": "singlestat" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Basic CPU info" + } + }, + "group": { + "name": "Basic CPU / Mem / Net / Disk" + }, + "name": "CPU Basic", + "pos": { + "h": 7, + "w": 12, + "x": 0, + "y": 6 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"system\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"user\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"iowait\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=~\".*irq\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": " sum by (instance) (\n irate(\n prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode!=\"idle\",mode!=\"iowait\",mode!=\"irq\",mode!=\"softirq\",mode!=\"system\",mode!=\"user\"}\n )\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "F", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"idle\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Basic memory usage" + } + }, + "group": { + "name": "Basic CPU / Mem / Net / Disk" + }, + "name": "Memory Basic", + "pos": { + "h": 7, + "w": 12, + "x": 12, + "y": 6 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_MemTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": " prom:node_memory_MemTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_MemFree_bytes{instance=\"#{node}\",job=\"#{job}\"}\n-\n (\n prom:node_memory_Cached_bytes{instance=\"#{node}\",job=\"#{job}\"}\n +\n prom:node_memory_Buffers_bytes{instance=\"#{node}\",job=\"#{job}\"}\n +\n prom:node_memory_SReclaimable_bytes{instance=\"#{node}\",job=\"#{job}\"}\n )", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": " prom:node_memory_Cached_bytes{instance=\"#{node}\",job=\"#{job}\"}\n +\n prom:node_memory_Buffers_bytes{instance=\"#{node}\",job=\"#{job}\"}\n+\n prom:node_memory_SReclaimable_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "prom:node_memory_MemFree_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": "(\n prom:node_memory_SwapTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_SwapFree_bytes{instance=\"#{node}\",job=\"#{job}\"}\n)", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Basic network info per interface" + } + }, + "group": { + "name": "Basic CPU / Mem / Net / Disk" + }, + "name": "Network Traffic Basic", + "pos": { + "h": 7, + "w": 12, + "x": 0, + "y": 13 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_receive_bytes_total{instance=\"#{node}\",job=\"#{job}\"}) * 8", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_network_transmit_bytes_total{instance=\"#{node}\",job=\"#{job}\"}) * 8", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Disk space used of all filesystems mounted" + } + }, + "group": { + "name": "Basic CPU / Mem / Net / Disk" + }, + "name": "Disk Space Used Basic", + "pos": { + "h": 7, + "w": 12, + "x": 12, + "y": 13 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " 100\n-\n (\n (prom:node_filesystem_avail_bytes{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"} * 100)\n /\n prom:node_filesystem_size_bytes{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"}\n )", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "CPU / Memory / Net / Disk" + }, + "name": "CPU", + "pos": { + "h": 12, + "w": 12, + "x": 0, + "y": 7 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"system\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"user\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"nice\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"iowait\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "F", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"irq\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "G", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"softirq\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "H", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"steal\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "J", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"idle\"})\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})))", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "CPU / Memory / Net / Disk" + }, + "name": "Memory Stack", + "pos": { + "h": 12, + "w": 12, + "x": 12, + "y": 7 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " prom:node_memory_MemTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_MemFree_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_Buffers_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_Cached_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_Slab_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_PageTables_bytes{instance=\"#{node}\",job=\"#{job}\"}\n-\n prom:node_memory_SwapCached_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_PageTables_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_memory_SwapCached_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "prom:node_memory_Slab_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": "prom:node_memory_Cached_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "F", + "funcList": [], + "q": "prom:node_memory_Buffers_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "G", + "funcList": [], + "q": "prom:node_memory_MemFree_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "H", + "funcList": [], + "q": "(\n prom:node_memory_SwapTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}\n -\n prom:node_memory_SwapFree_bytes{instance=\"#{node}\",job=\"#{job}\"}\n)", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "I", + "funcList": [], + "q": "prom:node_memory_HardwareCorrupted_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "CPU / Memory / Net / Disk" + }, + "name": "Network Traffic", + "pos": { + "h": 12, + "w": 12, + "x": 0, + "y": 19 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_receive_bytes_total{instance=\"#{node}\",job=\"#{job}\"}) * 8", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_network_transmit_bytes_total{instance=\"#{node}\",job=\"#{job}\"}) * 8", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "CPU / Memory / Net / Disk" + }, + "name": "Disk Space Used", + "pos": { + "h": 12, + "w": 12, + "x": 12, + "y": 19 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " prom:node_filesystem_size_bytes{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"}\n-\n prom:node_filesystem_avail_bytes{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "CPU / Memory / Net / Disk" + }, + "name": "Disk IOps", + "pos": { + "h": 12, + "w": 12, + "x": 0, + "y": 31 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(\n prom:node_disk_reads_completed_total{device=~\"#{diskdevices}\",instance=\"#{node}\",job=\"#{job}\"}\n)", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(\n prom:node_disk_writes_completed_total{device=~\"#{diskdevices}\",instance=\"#{node}\",job=\"#{job}\"}\n)", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "CPU / Memory / Net / Disk" + }, + "name": "I/O Usage Read / Write", + "pos": { + "h": 12, + "w": 12, + "x": 12, + "y": 31 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(\n prom:node_disk_read_bytes_total{device=~\"#{diskdevices}\",instance=\"#{node}\",job=\"#{job}\"}\n)", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(\n prom:node_disk_written_bytes_total{device=~\"#{diskdevices}\",instance=\"#{node}\",job=\"#{job}\"}\n)", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "CPU / Memory / Net / Disk" + }, + "name": "I/O Utilization", + "pos": { + "h": 12, + "w": 12, + "x": 0, + "y": 43 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(\n prom:node_disk_io_time_seconds_total{device=~\"#{diskdevices}\",instance=\"#{node}\",job=\"#{job}\"}\n)", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "CPU / Memory / Net / Disk" + }, + "name": "CPU spent seconds in guests (VMs)", + "pos": { + "h": 12, + "w": 12, + "x": 12, + "y": 43 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_guest_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"user\"}[1m])\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"}[1m])))", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": " sum by (instance) (\n irate(prom:node_cpu_guest_seconds_total{instance=\"#{node}\",job=\"#{job}\",mode=\"nice\"}[1m])\n )\n/ on (instance) group_left ()\n sum by (instance) ((irate(prom:node_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"}[1m])))", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Active / Inactive", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 38 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_Inactive_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_Active_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Committed", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 38 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_Committed_AS_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_CommitLimit_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Active / Inactive Detail", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 48 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_Inactive_file_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_Inactive_anon_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_memory_Active_file_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "prom:node_memory_Active_anon_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Writeback and Dirty", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 48 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_Writeback_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_WritebackTmp_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_memory_Dirty_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Shared and Mapped", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 58 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_Mapped_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_Shmem_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_memory_ShmemHugePages_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "prom:node_memory_ShmemPmdMapped_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Slab", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 58 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_SUnreclaim_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_SReclaimable_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Vmalloc", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 68 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_VmallocChunk_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_VmallocTotal_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_memory_VmallocUsed_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Bounce", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 68 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_Bounce_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Anonymous", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 78 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_AnonHugePages_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_AnonPages_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Kernel / CPU", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 78 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_KernelStack_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_Percpu_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory HugePages Counter", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 88 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_HugePages_Free{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_HugePages_Rsvd{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_memory_HugePages_Surp{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory HugePages Size", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 88 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_HugePages_Total{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_Hugepagesize_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory DirectMap", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 98 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_DirectMap1G_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_DirectMap2M_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_memory_DirectMap4k_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory Unevictable and MLocked", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 98 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_Unevictable_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_memory_Mlocked_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Meminfo" + }, + "name": "Memory NFS", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 108 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_memory_NFS_Unstable_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Vmstat" + }, + "name": "Memory Pages In / Out", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 25 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_vmstat_pgpgin{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_vmstat_pgpgout{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Vmstat" + }, + "name": "Memory Pages Swap In / Out", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 25 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_vmstat_pswpin{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_vmstat_pswpout{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Vmstat" + }, + "name": "Memory Page Faults", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 35 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_vmstat_pgfault{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_vmstat_pgmajfault{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": " irate(prom:node_vmstat_pgfault{instance=\"#{node}\",job=\"#{job}\"})\n-\n irate(prom:node_vmstat_pgmajfault{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Memory Vmstat" + }, + "name": "OOM Killer", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 35 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_vmstat_oom_kill{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Timesync" + }, + "name": "Time Synchronized Drift", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 40 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_timex_estimated_error_seconds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_timex_offset_seconds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_timex_maxerror_seconds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Timesync" + }, + "name": "Time PLL Adjust", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 40 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_timex_loop_time_constant{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Timesync" + }, + "name": "Time Synchronized Status", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 50 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_timex_sync_status{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_timex_frequency_adjustment_ratio{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Timesync" + }, + "name": "Time Misc", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 50 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_timex_tick_seconds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_timex_tai_offset_seconds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Processes" + }, + "name": "Processes Status", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 27 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_procs_blocked{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_procs_running{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Processes" + }, + "name": "Processes State", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 27 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_processes_state{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Processes" + }, + "name": "Processes Forks", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 37 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_forks_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Processes" + }, + "name": "Processes Memory", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 37 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:process_virtual_memory_bytes{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:process_resident_memory_max_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "irate(prom:process_virtual_memory_bytes{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "irate(prom:process_virtual_memory_max_bytes{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Processes" + }, + "name": "PIDs Number and Limit", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 47 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_processes_pids{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_processes_max_processes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Processes" + }, + "name": "Process schedule stats Running / Waiting", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 47 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_schedstat_running_seconds_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_schedstat_waiting_seconds_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Processes" + }, + "name": "Threads Number and Limit", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 57 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_processes_threads{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_processes_max_threads{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Misc" + }, + "name": "Context Switches / Interrupts", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 42 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_context_switches_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_intr_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Misc" + }, + "name": "System Load", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 42 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_load1{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_load5{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_load15{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Misc" + }, + "name": "Interrupts Detail", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 52 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_interrupts_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Misc" + }, + "name": "Schedule timeslices executed by each cpu", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 52 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_schedstat_timeslices_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Misc" + }, + "name": "Entropy", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 62 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_entropy_available_bits{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Misc" + }, + "name": "CPU time spent in user and system contexts", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 62 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:process_cpu_seconds_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "System Misc" + }, + "name": "File Descriptors", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 72 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:process_max_fds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:process_open_fds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Hardware Misc" + }, + "name": "Hardware temperature monitor", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 43 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_hwmon_temp_celsius{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": true, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_hwmon_temp_crit_alarm_celsius{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_hwmon_temp_crit_celsius{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": true, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "prom:node_hwmon_temp_crit_hyst_celsius{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": true, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": "prom:node_hwmon_temp_max_celsius{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Hardware Misc" + }, + "name": "Throttle cooling device", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 43 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_cooling_device_cur_state{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_cooling_device_max_state{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Hardware Misc" + }, + "name": "Power supply", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 53 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_power_supply_online{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Systemd" + }, + "name": "Systemd Sockets", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 30 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_systemd_socket_accepted_connections_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Systemd" + }, + "name": "Systemd Units State", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 30 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_systemd_units{instance=\"#{node}\",job=\"#{job}\",state=\"activating\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_systemd_units{instance=\"#{node}\",job=\"#{job}\",state=\"active\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_systemd_units{instance=\"#{node}\",job=\"#{job}\",state=\"deactivating\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "prom:node_systemd_units{instance=\"#{node}\",job=\"#{job}\",state=\"failed\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": "prom:node_systemd_units{instance=\"#{node}\",job=\"#{job}\",state=\"inactive\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "The number (after merges) of I/O requests completed per second for the device" + } + }, + "group": { + "name": "Storage Disk" + }, + "name": "Disk IOps Completed", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 31 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_disk_reads_completed_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_disk_writes_completed_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "The number of bytes read from or written to the device per second" + } + }, + "group": { + "name": "Storage Disk" + }, + "name": "Disk R/W Data", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 31 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_disk_read_bytes_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_disk_written_bytes_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "The average time for requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them." + } + }, + "group": { + "name": "Storage Disk" + }, + "name": "Disk Average Wait Time", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 41 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": " irate(prom:node_disk_read_time_seconds_total{instance=\"#{node}\",job=\"#{job}\"})\n/\n irate(prom:node_disk_reads_completed_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": " irate(prom:node_disk_write_time_seconds_total{instance=\"#{node}\",job=\"#{job}\"})\n/\n irate(prom:node_disk_writes_completed_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "The average queue length of the requests that were issued to the device" + } + }, + "group": { + "name": "Storage Disk" + }, + "name": "Average Queue Size", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 41 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_disk_io_time_weighted_seconds_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "The number of read and write requests merged per second that were queued to the device" + } + }, + "group": { + "name": "Storage Disk" + }, + "name": "Disk R/W Merged", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 51 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_disk_reads_merged_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_disk_writes_merged_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Percentage of elapsed time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100% for devices serving requests serially. But for devices serving requests in parallel, such as RAID arrays and modern SSDs, this number does not reflect their performance limits." + } + }, + "group": { + "name": "Storage Disk" + }, + "name": "Time Spent Doing I/Os", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 51 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_disk_io_time_seconds_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_disk_discard_time_seconds_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "The number of outstanding requests at the instant the sample was taken. Incremented as requests are given to appropriate struct request_queue and decremented as they finish." + } + }, + "group": { + "name": "Storage Disk" + }, + "name": "Instantaneous Queue Size", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 61 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_disk_io_now{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Storage Disk" + }, + "name": "Disk IOps Discards completed / merged", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 61 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_disk_discards_completed_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_disk_discards_merged_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Storage Filesystem" + }, + "name": "Filesystem space available", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 46 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_filesystem_avail_bytes{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": true, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_filesystem_free_bytes{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": true, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_filesystem_size_bytes{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Storage Filesystem" + }, + "name": "File Nodes Free", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 46 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_filesystem_files_free{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Storage Filesystem" + }, + "name": "File Descriptor", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 56 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_filefd_maximum{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_filefd_allocated{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Storage Filesystem" + }, + "name": "File Nodes Size", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 56 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_filesystem_files{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Storage Filesystem" + }, + "name": "Filesystem in ReadOnly / Error", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 66 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_filesystem_readonly{device!~\"rootfs\",instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_filesystem_device_error{device!~\"rootfs\",fstype!~\"tmpfs\",instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Traffic by Packets", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 31 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_receive_packets_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_network_transmit_packets_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Traffic Errors", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 31 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_receive_errs_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_network_transmit_errs_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Traffic Drop", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 41 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_receive_drop_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_network_transmit_drop_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Traffic Compressed", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 41 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_receive_compressed_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_network_transmit_compressed_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Traffic Multicast", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 51 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_receive_multicast_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Traffic Fifo", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 51 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_receive_fifo_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_network_transmit_fifo_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Traffic Frame", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 61 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_receive_frame_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Traffic Carrier", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 61 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_transmit_carrier_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Traffic Colls", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 71 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_network_transmit_colls_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "NF Contrack", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 71 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_nf_conntrack_entries{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_nf_conntrack_entries_limit{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "ARP Entries", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 81 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_arp_entries{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "MTU", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 81 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_network_mtu_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Speed", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 91 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_network_speed_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Queue Length", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 91 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_network_transmit_queue_length{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Softnet Packets", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 101 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_softnet_processed_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_softnet_dropped_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Softnet Out of Quota", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 101 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_softnet_times_squeezed_total{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Traffic" + }, + "name": "Network Operational Status", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 111 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_network_up{instance=\"#{node}\",job=\"#{job}\",operstate=\"up\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_network_carrier{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Sockstat" + }, + "name": "Sockstat TCP", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 32 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_sockstat_TCP_alloc{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_sockstat_TCP_inuse{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": true, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_sockstat_TCP_mem{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "prom:node_sockstat_TCP_orphan{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": "prom:node_sockstat_TCP_tw{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Sockstat" + }, + "name": "Sockstat UDP", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 32 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_sockstat_UDPLITE_inuse{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_sockstat_UDP_inuse{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_sockstat_UDP_mem{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Sockstat" + }, + "name": "Sockstat FRAG / RAW", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 42 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_sockstat_FRAG_inuse{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_sockstat_RAW_inuse{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Sockstat" + }, + "name": "Sockstat Memory Size", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 42 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_sockstat_TCP_mem_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_sockstat_UDP_mem_bytes{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_sockstat_FRAG_memory{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Sockstat" + }, + "name": "Sockstat Used", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 52 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_sockstat_sockets_used{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "Netstat IP In / Out Octets", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 33 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_IpExt_InOctets{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_netstat_IpExt_OutOctets{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "Netstat IP Forwarding", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 33 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_Ip_Forwarding{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "ICMP In / Out", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 43 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_Icmp_InMsgs{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_netstat_Icmp_OutMsgs{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "ICMP Errors", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 43 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_Icmp_InErrors{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "UDP In / Out", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 53 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_Udp_InDatagrams{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_netstat_Udp_OutDatagrams{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "UDP Errors", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 53 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_Udp_InErrors{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_netstat_Udp_NoPorts{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "irate(prom:node_netstat_UdpLite_InErrors{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "irate(prom:node_netstat_Udp_RcvbufErrors{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": "irate(prom:node_netstat_Udp_SndbufErrors{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "TCP In / Out", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 63 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_Tcp_InSegs{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_netstat_Tcp_OutSegs{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "TCP Errors", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 63 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_TcpExt_ListenOverflows{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_netstat_TcpExt_ListenDrops{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "irate(prom:node_netstat_TcpExt_TCPSynRetrans{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "irate(prom:node_netstat_Tcp_RetransSegs{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "E", + "funcList": [], + "q": "irate(prom:node_netstat_Tcp_InErrs{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "F", + "funcList": [], + "q": "irate(prom:node_netstat_Tcp_OutRsts{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "TCP Connections", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 73 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_netstat_Tcp_CurrEstab{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_netstat_Tcp_MaxConn{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "TCP SynCookie", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 73 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_TcpExt_SyncookiesFailed{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_netstat_TcpExt_SyncookiesRecv{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "irate(prom:node_netstat_TcpExt_SyncookiesSent{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "TCP Direct Transition", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 83 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "irate(prom:node_netstat_Tcp_ActiveOpens{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "irate(prom:node_netstat_Tcp_PassiveOpens{instance=\"#{node}\",job=\"#{job}\"})", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "Enable with --collector.tcpstat argument on node-exporter" + } + }, + "group": { + "name": "Network Netstat" + }, + "name": "TCP Stat", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 83 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_tcp_connection_states{instance=\"#{node}\",job=\"#{job}\",state=\"established\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_tcp_connection_states{instance=\"#{node}\",job=\"#{job}\",state=\"fin_wait2\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "C", + "funcList": [], + "q": "prom:node_tcp_connection_states{instance=\"#{node}\",job=\"#{job}\",state=\"listen\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "D", + "funcList": [], + "q": "prom:node_tcp_connection_states{instance=\"#{node}\",job=\"#{job}\",state=\"time_wait\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Node Exporter" + }, + "name": "Node Exporter Scrape Time", + "pos": { + "h": 10, + "w": 12, + "x": 0, + "y": 50 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_scrape_collector_duration_seconds{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + }, + { + "extend": { + "settings": { + "chartType": "areaLine", + "showFieldMapping": false, + "showTitle": true, + "timeInterval": "auto", + "titleDesc": "" + } + }, + "group": { + "name": "Node Exporter" + }, + "name": "Node Exporter Scrape", + "pos": { + "h": 10, + "w": 12, + "x": 12, + "y": 50 + }, + "queries": [ + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "A", + "funcList": [], + "q": "prom:node_scrape_collector_success{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + }, + { + "color": "", + "datasource": "dataflux", + "disabled": false, + "name": "", + "qtype": "promql", + "query": { + "code": "B", + "funcList": [], + "q": "prom:node_textfile_scrape_error{instance=\"#{node}\",job=\"#{job}\"}", + "type": "promql" + }, + "type": "sequence" + } + ], + "type": "sequence" + } + ], + "groups": [ + "Quick CPU / Mem / Disk", + "Basic CPU / Mem / Net / Disk", + "CPU / Memory / Net / Disk", + "Memory Meminfo", + "Memory Vmstat", + "System Timesync", + "System Processes", + "System Misc", + "Hardware Misc", + "Systemd", + "Storage Disk", + "Storage Filesystem", + "Network Traffic", + "Network Sockstat", + "Network Netstat", + "Node Exporter" + ], + "type": "template", + "vars": [ + { + "code": "job", + "datasource": "dataflux", + "definition": { + "defaultVal": { + "label": "", + "value": "" + }, + "field": "", + "metric": "", + "object": "", + "tag": "", + "value": "SHOW_TAG_VALUE(from=['prom'], keyin=['job'])" + }, + "hide": 0, + "isHiddenAsterisk": 0, + "name": "Job", + "seq": 2, + "type": "QUERY", + "valueSort": "asc" + }, + { + "code": "node", + "datasource": "dataflux", + "definition": { + "defaultVal": { + "label": "", + "value": "" + }, + "field": "", + "metric": "", + "object": "", + "tag": "", + "value": "SHOW_TAG_VALUE(from=['prom'], keyin=['instance'])" + }, + "hide": 0, + "isHiddenAsterisk": 0, + "name": "Host:", + "seq": 2, + "type": "QUERY", + "valueSort": "asc" + } + ] + }, + "summary": "", + "tagInfo": [], + "tags": [ + "linux" + ], + "thumbnail": "", + "title": "Node Exporter Full" +} \ No newline at end of file diff --git a/specs/iac/import/grafana/snapshot/outputs.tf b/specs/iac/import/grafana/snapshot/outputs.tf new file mode 100644 index 0000000..4089ffd --- /dev/null +++ b/specs/iac/import/grafana/snapshot/outputs.tf @@ -0,0 +1,4 @@ +output "dashboard_id" { + description = "The `guance_dashboard`'s id." + value = guance_dashboard.main.id +} diff --git a/specs/iac/import/grafana/snapshot/variables.tf b/specs/iac/import/grafana/snapshot/variables.tf new file mode 100644 index 0000000..e6946a4 --- /dev/null +++ b/specs/iac/import/grafana/snapshot/variables.tf @@ -0,0 +1,4 @@ +variable "name" { + type = string + description = "(Required) The name of dashboard." +} diff --git a/specs/iac/import/grafana/snapshot/versions.tf b/specs/iac/import/grafana/snapshot/versions.tf new file mode 100644 index 0000000..a21c1dd --- /dev/null +++ b/specs/iac/import/grafana/snapshot/versions.tf @@ -0,0 +1,9 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + guance = { + source = "GuanceCloud/guance" + } + } +}