Skip to content

Commit

Permalink
feat: first test adding datasource variable
Browse files Browse the repository at this point in the history
  • Loading branch information
keithf4 committed May 17, 2024
1 parent 0a3a766 commit c246c04
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 18 deletions.
35 changes: 27 additions & 8 deletions grafana/postgres/Bloat_Details.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PDC1078F23EBDF0E5"
"uid": "${ccp_datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -105,7 +105,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PDC1078F23EBDF0E5"
"uid": "${ccp_datasource}"
},
"expr": "sum(ccp_bloat_check_total_wasted_space_bytes{cluster_name=\"[[pgcluster]]\", job=\"[[pgnodes]]\"})/sum(ccp_bloat_check_size_bytes{cluster_name=\"[[pgcluster]]\", job=\"[[pgnodes]]\"})*100",
"format": "time_series",
Expand All @@ -122,7 +122,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PDC1078F23EBDF0E5"
"uid": "${ccp_datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -209,7 +209,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PDC1078F23EBDF0E5"
"uid": "${ccp_datasource}"
},
"expr": "ccp_bloat_check_total_wasted_space_bytes{cluster_name=\"[[pgcluster]]\", job=\"[[pgnodes]]\", dbname=\"[[pgdatabase]]\", schemaname=\"[[schemaname]]\",objectname=\"[[objectname]]\"}",
"format": "time_series",
Expand Down Expand Up @@ -333,11 +333,30 @@
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": true,
"text": "PROMETHEUS",
"value": "PDC1078F23EBDF0E5"
},
"hide": 0,
"includeAll": false,
"label": "Datasource",
"multi": false,
"name": "ccp_datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": false,
"text": "hotel",
"value": "hotel"
"text": "iota",
"value": "iota"
},
"datasource": {
"type": "prometheus",
Expand Down Expand Up @@ -366,8 +385,8 @@
{
"current": {
"selected": false,
"text": "hotel_ip16_pg1",
"value": "hotel_ip16_pg1"
"text": "iota_ip16_pg1",
"value": "iota_ip16_pg1"
},
"datasource": {
"type": "prometheus",
Expand Down
39 changes: 29 additions & 10 deletions grafana/postgres/CRUD_Details.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PDC1078F23EBDF0E5"
"uid": "${ccp_datasource}"
},
"fieldConfig": {
"defaults": {
Expand Down Expand Up @@ -105,7 +105,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PDC1078F23EBDF0E5"
"uid": "${ccp_datasource}"
},
"expr": "rate(ccp_stat_user_tables_n_tup_ins{cluster_name=\"[[pgcluster]]\", job=~\"[[pgnodes]]\", dbname = \"[[pgdatabase]]\", schemaname = \"[[schemaname]]\", relname=\"[[tablename]]\"}[60s])",
"format": "time_series",
Expand All @@ -118,7 +118,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PDC1078F23EBDF0E5"
"uid": "${ccp_datasource}"
},
"expr": "rate(ccp_stat_user_tables_n_tup_upd{cluster_name=\"[[pgcluster]]\", job=~\"[[pgnodes]]\", dbname = \"[[pgdatabase]]\", schemaname = \"[[schemaname]]\", relname=\"[[tablename]]\"}[60s])",
"format": "time_series",
Expand All @@ -131,7 +131,7 @@
{
"datasource": {
"type": "prometheus",
"uid": "PDC1078F23EBDF0E5"
"uid": "${ccp_datasource}"
},
"expr": "rate(ccp_stat_user_tables_n_tup_del{cluster_name=\"[[pgcluster]]\", job=~\"[[pgnodes]]\", dbname = \"[[pgdatabase]]\", schemaname = \"[[schemaname]]\", relname=\"[[tablename]]\"}[60s])",
"format": "time_series",
Expand All @@ -154,8 +154,27 @@
{
"current": {
"selected": false,
"text": "hotel",
"value": "hotel"
"text": "PROMETHEUS",
"value": "PDC1078F23EBDF0E5"
},
"hide": 0,
"includeAll": false,
"label": "Datasource",
"multi": false,
"name": "ccp_datasource",
"options": [],
"query": "prometheus",
"queryValue": "",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"type": "datasource"
},
{
"current": {
"selected": false,
"text": "iota",
"value": "iota"
},
"datasource": {
"type": "prometheus",
Expand Down Expand Up @@ -184,8 +203,8 @@
{
"current": {
"selected": false,
"text": "hotel_ip16_pg1",
"value": "hotel_ip16_pg1"
"text": "iota_ip16_pg1",
"value": "iota_ip16_pg1"
},
"datasource": {
"type": "prometheus",
Expand Down Expand Up @@ -213,7 +232,7 @@
},
{
"current": {
"selected": true,
"selected": false,
"text": "postgres",
"value": "postgres"
},
Expand Down Expand Up @@ -243,7 +262,7 @@
},
{
"current": {
"selected": true,
"selected": false,
"text": "pgmonitor_ext",
"value": "pgmonitor_ext"
},
Expand Down

0 comments on commit c246c04

Please sign in to comment.