From aeb387451cb4f799e9a06aeba71dcb09f87c01de Mon Sep 17 00:00:00 2001 From: Vlad Saveliev Date: Wed, 29 Nov 2017 22:46:17 +0700 Subject: [PATCH] updated cockroachd scrape configs, added grafana dashboards in prometheus role --- roles/prometheus/README.md | 2 +- .../templates/grafana-dashboards/all.yml | 44 ++++ .../cockroachdb/replicas.json | 3 + .../cockroachdb/runtime.json | 3 + .../grafana-dashboards/cockroachdb/sql.json | 3 + .../cockroachdb/storage.json | 3 + .../grafana-dashboards/http-service.json | 249 ++++++++++++++++++ .../grafana-dashboards/template.json | 15 ++ roles/prometheus/templates/grafana.yaml | 27 +- .../templates/scrape_configs/all.yml | 4 + .../templates/scrape_configs/cockroachdb.yml | 44 ++++ .../templates/scrape_configs/kubernetes.yml | 6 + 12 files changed, 376 insertions(+), 27 deletions(-) create mode 100644 roles/prometheus/templates/grafana-dashboards/all.yml create mode 100644 roles/prometheus/templates/grafana-dashboards/cockroachdb/replicas.json create mode 100644 roles/prometheus/templates/grafana-dashboards/cockroachdb/runtime.json create mode 100644 roles/prometheus/templates/grafana-dashboards/cockroachdb/sql.json create mode 100644 roles/prometheus/templates/grafana-dashboards/cockroachdb/storage.json create mode 100644 roles/prometheus/templates/grafana-dashboards/http-service.json create mode 100644 roles/prometheus/templates/grafana-dashboards/template.json create mode 100644 roles/prometheus/templates/scrape_configs/cockroachdb.yml diff --git a/roles/prometheus/README.md b/roles/prometheus/README.md index 4a3bda3..7cdbf78 100644 --- a/roles/prometheus/README.md +++ b/roles/prometheus/README.md @@ -101,7 +101,7 @@ How to add dashboard in Grafana 1. create a new dashboard manually via `Dashboards --> New` or find existing on [grafana.com](https://grafana.com/dashboards) 2. export (download) it on your computer 3. copy content of downloaded JSON file -4. create a new file in `templates/grafana-dashboards` directory. Template: +4. create a new file in `templates/grafana-dashboards` directory. Template (`templates/grafana-dashboards/dashboard-template.json`): {% raw %} { diff --git a/roles/prometheus/templates/grafana-dashboards/all.yml b/roles/prometheus/templates/grafana-dashboards/all.yml new file mode 100644 index 0000000..23b2137 --- /dev/null +++ b/roles/prometheus/templates/grafana-dashboards/all.yml @@ -0,0 +1,44 @@ + capacity-planning-dashboard.json: |- +{% include 'grafana-dashboards/capacity-planning.json' %} + + cluster-health-dashboard.json: |- +{% include 'grafana-dashboards/cluster-health.json' %} + + cluster-monitoring-dashboard.json: |- +{% include 'grafana-dashboards/cluster-monitoring.json' %} + + cluster-status-dashboard.json: |- +{% include 'grafana-dashboards/cluster-status.json' %} + + control-plane-status-dashboard.json: |- +{% include 'grafana-dashboards/control-plane-status.json' %} + + deployment-dashboard.json: |- +{% include 'grafana-dashboards/deployment.json' %} + + nodes-dashboard.json: |- +{% include 'grafana-dashboards/nodes.json' %} + + pods-dashboard.json: |- +{% include 'grafana-dashboards/pods.json' %} + + resource-requests-dashboard.json: |- +{% include 'grafana-dashboards/resource-requests.json' %} + +{% if k8s_prometheus_scrape_cockroachdb_metrics %} + + cockroachdb-replicas-dashboard.json: |- +{% include 'grafana-dashboards/cockroachdb/replicas.json' %} + + cockroachdb-runtime-dashboard.json: |- +{% include 'grafana-dashboards/cockroachdb/runtime.json' %} + + cockroachdb-sql-dashboard.json: |- +{% include 'grafana-dashboards/cockroachdb/sql.json' %} + + cockroachdb-storage-dashboard.json: |- +{% include 'grafana-dashboards/cockroachdb/storage.json' %} + + + +{% endif %} \ No newline at end of file diff --git a/roles/prometheus/templates/grafana-dashboards/cockroachdb/replicas.json b/roles/prometheus/templates/grafana-dashboards/cockroachdb/replicas.json new file mode 100644 index 0000000..ee325a4 --- /dev/null +++ b/roles/prometheus/templates/grafana-dashboards/cockroachdb/replicas.json @@ -0,0 +1,3 @@ +{% raw %} + {"dashboard":{"__inputs":[{"name":"DS_PROMETHEUS","label":"Prometheus","description":"","type":"datasource","pluginId":"prometheus","pluginName":"Prometheus"}],"__requires":[{"type":"panel","id":"graph","name":"Graph","version":""},{"type":"panel","id":"table","name":"Table","version":""},{"type":"grafana","id":"grafana","name":"Grafana","version":"3.1.1"},{"type":"datasource","id":"prometheus","name":"Prometheus","version":"1.0.0"}],"id":null,"title":"Cockroach Replicas","tags":["cockroach"],"style":"dark","timezone":"utc","editable":true,"hideControls":false,"sharedCrosshair":true,"rows":[{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":16,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[{"alias":"unavailable","yaxis":2},{"alias":"raft leaders not lease holders","yaxis":2},{"alias":"under-replicated","yaxis":1}],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sum(ranges{cluster=\"$cluster\",instance=~\"$node\"}) by (instance))","intervalFactor":2,"legendFormat":"ranges","refId":"D","step":120},{"expr":"sum(sum(replicas_leaders{cluster=\"$cluster\",instance=~\"$node\"}) by (instance))","interval":"","intervalFactor":2,"legendFormat":"raft leaders","metric":"","refId":"A","step":120},{"expr":"sum(sum(replicas_leaders_not_leaseholders{cluster=\"$cluster\",instance=~\"$node\"}) by (instance))","interval":"","intervalFactor":2,"legendFormat":"raft leaders not lease holders","metric":"","refId":"C","step":120},{"expr":"sum(sum(ranges_unavailable{cluster=\"$cluster\",instance=~\"$node\"}) by (instance))","interval":"","intervalFactor":2,"legendFormat":"unavailable","metric":"","refId":"B","step":120},{"expr":"sum(sum(ranges_underreplicated{cluster=\"$cluster\",instance=~\"$node\"}) by (instance))","intervalFactor":2,"legendFormat":"under-replicated","refId":"E","step":120}],"timeFrom":null,"timeShift":null,"title":"Ranges: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":17,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":false},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"sum(ranges{cluster=\"$cluster\",instance=~\"$node\"}) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}} - ranges","metric":"","refId":"A","step":240},{"expr":"sum(ranges_unavailable{cluster=\"$cluster\",instance=~\"$node\"}) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}} - unavailable","metric":"","refId":"B","step":240}],"title":"Ranges: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":28,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(replicas{cluster=\"$cluster\",instance=~\"$node\"}) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}}","metric":"","refId":"A","step":120}],"timeFrom":null,"timeShift":null,"title":"Replicas per node: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":29,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":false},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"sum(replicas{cluster=\"$cluster\",instance=~\"$node\"}) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}}","metric":"","refId":"A","step":240}],"title":"Replicas: $node","transform":"timeseries_aggregations","type":"table"},{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":41,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(replicas_leaseholders{cluster=\"$cluster\",instance=~\"$node\"}) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}}","metric":"","refId":"A","step":120}],"timeFrom":null,"timeShift":null,"title":"Replica leaseholders per node: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":40,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":false},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"sum(replicas_leaseholders{cluster=\"$cluster\",instance=~\"$node\"}) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}}","metric":"","refId":"A","step":240}],"title":"Replica leaseholders: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":30,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sum(replicas{cluster=\"$cluster\",instance=~\"$node\"}) by (instance))","interval":"","intervalFactor":2,"legendFormat":"Replicas","refId":"A","step":120},{"expr":"sum(sum(replicas_quiescent{cluster=\"$cluster\",instance=~\"$node\"}) by (instance))","interval":"","intervalFactor":2,"legendFormat":"Quiescent","refId":"B","step":120},{"expr":"sum(sum(replicas{cluster=\"$cluster\",instance=~\"$node\"}) by (instance) - sum(replicas_quiescent{cluster=\"$cluster\",instance=~\"$node\"}) by (instance))","intervalFactor":2,"legendFormat":"Active","refId":"C","step":120}],"timeFrom":null,"timeShift":null,"title":"Replicas: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":31,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Time","type":"date"},{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"sum(replicas_quiescent{cluster=\"$cluster\",instance=~\"$node\"}) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}}","refId":"A","step":240}],"title":"Quiescent Replicas: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":9,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sum(rate(range_splits{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance))","interval":"","intervalFactor":2,"legendFormat":"splits","metric":"","refId":"A","step":120},{"expr":"sum(sum(rate(range_adds{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance))","interval":"","intervalFactor":2,"legendFormat":"adds","metric":"","refId":"B","step":120},{"expr":"sum(sum(rate(range_removes{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance))","interval":"","intervalFactor":2,"legendFormat":"removes","metric":"","refId":"C","step":120}],"timeFrom":null,"timeShift":null,"title":"Range Ops: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"ops","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":14,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Time","type":"date"},{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"sum(rate(range_splits{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance) + sum(rate(range_adds{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance) + sum(rate(range_removes{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}}","metric":"","refId":"A","step":240}],"title":"Range Ops: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":7,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[{"alias":"Reserved Capacity","yaxis":2}],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sum(rate(range_snapshots_generated{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance))","interval":"","intervalFactor":2,"legendFormat":"Generated","metric":"","refId":"A","step":120},{"expr":"sum(sum(rate(range_snapshots_normal_applied{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance))","interval":"","intervalFactor":2,"legendFormat":"Normal-applied","metric":"","refId":"B","step":120},{"expr":"sum(sum(rate(range_snapshots_preemptive_applied{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance))","interval":"","intervalFactor":2,"legendFormat":"Preemptive-applied","refId":"C","step":120},{"expr":"sum(capacity_reserved{cluster=\"$cluster\",instance=~\"$node\"})","hide":false,"interval":"","intervalFactor":2,"legendFormat":"Reserved Capacity","refId":"D","step":120},{"expr":"sum(replicas_reserved{cluster=\"$cluster\",instance=~\"$node\"})","intervalFactor":2,"legendFormat":"Reservations","refId":"E","step":120}],"timeFrom":null,"timeShift":null,"title":"Snapshots: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"ops","label":"Snapshots","logBase":1,"max":null,"min":0,"show":true},{"format":"KBs","label":"Reservations","logBase":1,"max":null,"min":0,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","hideTimeOverride":false,"id":13,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat":"YYYY-MM-DD HH:mm:ss","decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"sum(rate(range_snapshots_generated{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}} - generated","refId":"A","step":240},{"expr":"sum(rate(range_snapshots_normal_applied{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance) + sum(rate(range_snapshots_preemptive_applied{cluster=\"$cluster\",instance=~\"$node\"}[$rate_interval])) by (instance)","interval":"","intervalFactor":2,"legendFormat":"{{instance}} - applied","metric":"","refId":"B","step":240}],"timeFrom":null,"timeShift":null,"title":"Snapshots: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"}],"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"]},"templating":{"list":[{"current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":false,"label":"Cluster name","multi":false,"name":"cluster","options":[],"query":"sys_uptime","refresh":1,"regex":"/cluster=\"([^\"]+)\"/","type":"query"},{"allValue":".*","current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":true,"label":"Node","multi":false,"name":"node","options":[],"query":"label_values(sys_uptime{job=\"cockroach\",cluster=\"$cluster\"},instance)","refresh":1,"regex":"","type":"query"},{"current":{"selected":true,"text":"1m","value":"1m"},"datasource":null,"hide":0,"includeAll":false,"label":"Rate Interval","multi":false,"name":"rate_interval","options":[{"selected":false,"text":"30s","value":"30s"},{"selected":true,"text":"1m","value":"1m"},{"selected":false,"text":"5m","value":"5m"},{"selected":false,"text":"10m","value":"10m"},{"selected":false,"text":"30m","value":"30m"},{"selected":false,"text":"1h","value":"1h"},{"selected":false,"text":"6h","value":"6h"},{"selected":false,"text":"12h","value":"12h"},{"selected":false,"text":"1d","value":"1d"}],"query":"30s,1m,5m,10m,30m,1h,6h,12h,1d","refresh":0,"type":"interval"}]},"annotations":{"list":[]},"refresh":false,"schemaVersion":12,"version":7,"links":[{"asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["cockroach"],"targetBlank":true,"title":"Dashboards","type":"dashboards"}],"gnetId":null},"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]} +{% endraw %} \ No newline at end of file diff --git a/roles/prometheus/templates/grafana-dashboards/cockroachdb/runtime.json b/roles/prometheus/templates/grafana-dashboards/cockroachdb/runtime.json new file mode 100644 index 0000000..74f728a --- /dev/null +++ b/roles/prometheus/templates/grafana-dashboards/cockroachdb/runtime.json @@ -0,0 +1,3 @@ +{% raw %} + {"dashboard":{"__inputs":[{"name":"DS_PROMETHEUS","label":"Prometheus","description":"","type":"datasource","pluginId":"prometheus","pluginName":"Prometheus"}],"__requires":[{"type":"panel","id":"graph","name":"Graph","version":""},{"type":"panel","id":"table","name":"Table","version":""},{"type":"grafana","id":"grafana","name":"Grafana","version":"3.1.1"},{"type":"datasource","id":"prometheus","name":"Prometheus","version":"1.0.0"}],"id":null,"title":"Cockroach Runtime","tags":["cockroach"],"style":"dark","timezone":"utc","editable":true,"hideControls":false,"sharedCrosshair":true,"rows":[{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":0,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":2,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[{"alias":"Live nodes","yaxis":1},{"alias":"All nodes","yaxis":1}],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"count(up{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"})","hide":false,"interval":"","intervalFactor":2,"legendFormat":"All nodes","metric":"","refId":"A","step":120},{"expr":"count(up{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"} == 1)","interval":"","intervalFactor":2,"legendFormat":"Live nodes","metric":"","refId":"B","step":120}],"timeFrom":null,"timeShift":null,"title":"Nodes: $node","tooltip":{"msResolution":true,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":"","logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":"","logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"}],"editable":true,"error":false,"fontSize":"90%","id":19,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[],"targets":[{"expr":"build_timestamp{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}} - {{tag}}","metric":"","refId":"A","step":240}],"title":"Built Timestamp","transform":"timeseries_aggregations","type":"table"}],"showTitle":false,"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":12,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sys_uptime{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":120}],"timeFrom":null,"timeShift":null,"title":"Uptime: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"s","label":null,"logBase":10,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"}],"editable":true,"error":false,"fontSize":"90%","id":13,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":1,"desc":false},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Current","type":"number","unit":"s"}],"targets":[{"expr":"sys_uptime{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","metric":"","refId":"A","step":240}],"title":"Uptime: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":9,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sys_rss{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"})","interval":"","intervalFactor":2,"legendFormat":"RSS","metric":"sys_rss","refId":"A","step":120},{"expr":"sum(sys_go_allocbytes{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"})","interval":"","intervalFactor":2,"legendFormat":"Go Allocated","metric":"sys_rss","refId":"C","step":120},{"expr":"sum(sys_go_totalbytes{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"})","interval":"","intervalFactor":2,"legendFormat":"Go Total","metric":"sys_cgo","refId":"D","step":120},{"expr":"sum(sys_cgo_allocbytes{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"})","interval":"","intervalFactor":2,"legendFormat":"CGo Allocated","metric":"sys_rss","refId":"B","step":120},{"expr":"sum(sys_cgo_totalbytes{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"})","interval":"","intervalFactor":2,"legendFormat":"CGo Total","metric":"sys_rss","refId":"E","step":120}],"timeFrom":null,"timeShift":null,"title":"Memory: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"bytes","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","hideTimeOverride":false,"id":10,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":null,"desc":false},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":".*","thresholds":[],"type":"number","unit":"bytes"}],"targets":[{"expr":"sys_rss{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":240}],"title":"RSS: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":11,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sys_goroutines{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"})","interval":"","intervalFactor":2,"legendFormat":"Goroutines","metric":"sys","refId":"A","step":120}],"timeFrom":null,"timeShift":null,"title":"Goroutines: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":15,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":false},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat":"YYYY-MM-DD HH:mm:ss","decimals":0,"pattern":"/.*/","thresholds":[],"type":"number","unit":"none"}],"targets":[{"expr":"sys_goroutines{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":240}],"title":"Goroutines: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":14,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[{"alias":"GC Pauses","yaxis":2}],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(rate(sys_gc_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"GC Runs","refId":"A","step":120},{"expr":"sum(rate(sys_gc_pause_ns{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"GC Pauses","metric":"","refId":"B","step":120}],"timeFrom":null,"timeShift":null,"title":"GC: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"ns","label":null,"logBase":1,"max":null,"min":0,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":16,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":false},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Time","type":"date"},{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"ns"}],"targets":[{"expr":"rate(sys_gc_pause_ns{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval])","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":240}],"title":"GC Pauses: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":17,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(rate(sys_cpu_user_ns{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"User","refId":"A","step":120},{"expr":"sum(rate(sys_cpu_sys_ns{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","intervalFactor":2,"legendFormat":"System","metric":"","refId":"B","step":120}],"timeFrom":null,"timeShift":null,"title":"CPU Time: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"ns","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":18,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"ns"}],"targets":[{"expr":"rate(sys_cpu_user_ns{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]) + rate(sys_cpu_sys_ns{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval])","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","metric":"","refId":"A","step":240}],"title":"CPU Time: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[],"title":"New row"}],"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"]},"templating":{"list":[{"current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":false,"label":"Cluster name","multi":false,"name":"cluster","options":[],"query":"sys_uptime","refresh":1,"regex":"/cluster=\"([^\"]+)\"/","type":"query"},{"allValue":".*","current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":true,"label":"Node","multi":false,"name":"node","options":[],"query":"label_values(sys_uptime{job=\"cockroach\",cluster=\"$cluster\"},kubernetes_pod_node_name)","refresh":1,"regex":"","type":"query"},{"auto":false,"current":{"selected":true,"text":"1m","value":"1m"},"datasource":null,"hide":0,"includeAll":false,"label":"Rate Interval","multi":false,"name":"rate_interval","options":[{"selected":false,"text":"30s","value":"30s"},{"selected":true,"text":"1m","value":"1m"},{"selected":false,"text":"5m","value":"5m"},{"selected":false,"text":"10m","value":"10m"},{"selected":false,"text":"30m","value":"30m"},{"selected":false,"text":"1h","value":"1h"},{"selected":false,"text":"6h","value":"6h"},{"selected":false,"text":"12h","value":"12h"},{"selected":false,"text":"1d","value":"1d"}],"query":"30s,1m,5m,10m,30m,1h,6h,12h,1d","refresh":0,"regex":"","type":"interval"}]},"annotations":{"list":[]},"refresh":"1m","schemaVersion":12,"version":62,"links":[{"asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["cockroach"],"targetBlank":true,"title":"Dashboards","type":"dashboards"}],"gnetId":null},"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]} +{% endraw %} \ No newline at end of file diff --git a/roles/prometheus/templates/grafana-dashboards/cockroachdb/sql.json b/roles/prometheus/templates/grafana-dashboards/cockroachdb/sql.json new file mode 100644 index 0000000..6189fbb --- /dev/null +++ b/roles/prometheus/templates/grafana-dashboards/cockroachdb/sql.json @@ -0,0 +1,3 @@ +{% raw %} + {"dashboard":{"__inputs":[{"name":"DS_PROMETHEUS","label":"Prometheus","description":"","type":"datasource","pluginId":"prometheus","pluginName":"Prometheus"}],"__requires":[{"type":"panel","id":"graph","name":"Graph","version":""},{"type":"panel","id":"table","name":"Table","version":""},{"type":"grafana","id":"grafana","name":"Grafana","version":"3.1.1"},{"type":"datasource","id":"prometheus","name":"Prometheus","version":"1.0.0"}],"id":null,"title":"Cockroach SQL","tags":["cockroach"],"style":"dark","timezone":"utc","editable":true,"hideControls":false,"sharedCrosshair":true,"rows":[{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":6,"isNew":true,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sql_conns{cluster=\"$cluster\",job=\"cockroach\",kubernetes_pod_node_name=~\"$node\"})","hide":false,"interval":"","intervalFactor":2,"legendFormat":"Connections","metric":"","refId":"A","step":120}],"timeFrom":null,"timeShift":null,"title":"SQL Connections: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":12,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":false},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Time","type":"date"},{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":0,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"sql_conns{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":240}],"title":"Connections: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":7,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(rate(sql_bytesin{job=\"cockroach\", cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"In","metric":"","refId":"A","step":120},{"expr":"sum(rate(sql_bytesout{job=\"cockroach\", cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"Out","metric":"","refId":"B","step":120}],"timeFrom":null,"timeShift":null,"title":"Bytes: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"Bps","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","hideTimeOverride":false,"id":13,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"dateFormat":"YYYY-MM-DD HH:mm:ss","decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"Bps"}],"targets":[{"expr":"rate(sql_bytesin{job=\"cockroach\", cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval])","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}} - in","refId":"A","step":240},{"expr":"rate(sql_bytesout{job=\"cockroach\", cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval])","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}} - out","metric":"","refId":"B","step":240}],"timeFrom":null,"timeShift":null,"title":"Bytes in/out: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":9,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(rate(sql_select_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"select","metric":"","refId":"A","step":120},{"expr":"sum(rate(sql_insert_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"insert","metric":"","refId":"B","step":120},{"expr":"sum(rate(sql_update_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"update","metric":"","refId":"C","step":120},{"expr":"sum(rate(sql_delete_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"delete","metric":"","refId":"D","step":120}],"timeFrom":null,"timeShift":null,"title":"Queries: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":14,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Time","type":"date"},{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"rate(sql_select_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]) + rate(sql_insert_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]) + rate(sql_update_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]) + rate(sql_delete_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval])","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","metric":"","refId":"A","step":240}],"title":"Queries: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":10,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(rate(sql_txn_begin_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"begin","metric":"","refId":"A","step":120},{"expr":"sum(rate(sql_txn_commit_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"commit","refId":"B","step":120},{"expr":"sum(rate(sql_txn_abort_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"abort","refId":"C","step":120},{"expr":"sum(rate(sql_txn_rollback_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"rollback","refId":"D","step":120}],"timeFrom":null,"timeShift":null,"title":"Transactions: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":15,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Time","type":"date"},{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"rate(sql_txn_begin_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]) + rate(sql_txn_commit_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]) + rate(sql_txn_abort_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]) + rate(sql_txn_rollback_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval])","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":240}],"title":"Transactions: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":11,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(rate(sql_ddl_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval]))","interval":"","intervalFactor":2,"legendFormat":"DDL","metric":"","refId":"A","step":120}],"timeFrom":null,"timeShift":null,"title":"Schema changes: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":16,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Time","type":"date"},{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"rate(sql_ddl_count{job=\"cockroach\",cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}[$rate_interval])","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","metric":"","refId":"A","step":240}],"title":"Schema Changes: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"}],"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"]},"templating":{"list":[{"current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":false,"label":"Cluster name","multi":false,"name":"cluster","options":[],"query":"sys_uptime","refresh":1,"regex":"/cluster=\"([^\"]+)\"/","type":"query"},{"allValue":".*","current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":true,"label":"Node","multi":false,"name":"node","options":[],"query":"label_values(sys_uptime{job=\"cockroach\",cluster=\"$cluster\"},kubernetes_pod_node_name)","refresh":1,"regex":"","type":"query"},{"current":{"selected":true,"text":"1m","value":"1m"},"datasource":null,"hide":0,"includeAll":false,"label":"Rate Interval","multi":false,"name":"rate_interval","options":[{"selected":false,"text":"30s","value":"30s"},{"selected":true,"text":"1m","value":"1m"},{"selected":false,"text":"5m","value":"5m"},{"selected":false,"text":"10m","value":"10m"},{"selected":false,"text":"30m","value":"30m"},{"selected":false,"text":"1h","value":"1h"},{"selected":false,"text":"6h","value":"6h"},{"selected":false,"text":"12h","value":"12h"},{"selected":false,"text":"1d","value":"1d"}],"query":"30s,1m,5m,10m,30m,1h,6h,12h,1d","refresh":0,"type":"interval"}]},"annotations":{"list":[]},"refresh":false,"schemaVersion":12,"version":33,"links":[{"asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["cockroach"],"targetBlank":true,"title":"Dashboards","type":"dashboards"}],"gnetId":null},"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]} +{% endraw %} \ No newline at end of file diff --git a/roles/prometheus/templates/grafana-dashboards/cockroachdb/storage.json b/roles/prometheus/templates/grafana-dashboards/cockroachdb/storage.json new file mode 100644 index 0000000..f2a1e82 --- /dev/null +++ b/roles/prometheus/templates/grafana-dashboards/cockroachdb/storage.json @@ -0,0 +1,3 @@ +{% raw %} + {"dashboard":{"__inputs":[{"name":"DS_PROMETHEUS","label":"Prometheus","description":"","type":"datasource","pluginId":"prometheus","pluginName":"Prometheus"}],"__requires":[{"type":"panel","id":"graph","name":"Graph","version":""},{"type":"panel","id":"table","name":"Table","version":""},{"type":"grafana","id":"grafana","name":"Grafana","version":"3.1.1"},{"type":"datasource","id":"prometheus","name":"Prometheus","version":"1.0.0"}],"id":null,"title":"Cockroach Storage","tags":["cockroach"],"style":"dark","timezone":"utc","editable":true,"hideControls":false,"sharedCrosshair":true,"rows":[{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":16,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sum(capacity{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name)) - sum(sum(capacity_available{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name))","interval":"","intervalFactor":2,"legendFormat":"Used","refId":"A","step":120},{"expr":"sum(sum(capacity{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name))","interval":"","intervalFactor":2,"legendFormat":"Capacity","metric":"","refId":"B","step":120}],"timeFrom":null,"timeShift":null,"title":"Capacity: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":"","logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":17,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":false},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"percentunit"}],"targets":[{"expr":"(sum(capacity{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name) - sum(capacity_available{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name)) / sum(capacity{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name)","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":240}],"title":"Capacity Used: $node","transform":"timeseries_aggregations","type":"table"},{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":22,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"1 - sum(capacity_available{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name) / sum(capacity{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name) ","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":120}],"timeFrom":null,"timeShift":null,"title":"Percentage of capacity used per node: All","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"percentunit","label":"","logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":23,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":false},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"percentunit"}],"targets":[{"expr":"1 - sum(capacity_available{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name) / sum(capacity{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name) ","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":240}],"title":"Percentage of capacity used per node: All","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":6,"isNew":true,"legend":{"alignAsTable":false,"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sum(livebytes{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name))","hide":false,"interval":"","intervalFactor":2,"legendFormat":"Live","metric":"","refId":"A","step":120},{"expr":"sum(sum(sysbytes{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name))","interval":"","intervalFactor":2,"legendFormat":"System","metric":"","refId":"C","step":120}],"timeFrom":null,"timeShift":null,"title":"Bytes: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"bytes","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":12,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":false},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"bytes"}],"targets":[{"expr":"sum(livebytes{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name)","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","metric":"","refId":"A","step":240}],"title":"Live Bytes: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":9,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"avg(avg(rocksdb_read_amplification{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name))","interval":"","intervalFactor":2,"legendFormat":"Read Amplification","metric":"","refId":"A","step":120}],"timeFrom":null,"timeShift":null,"title":"Read Amplification: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":0,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":14,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Time","type":"date"},{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"avg(rocksdb_read_amplification{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name)","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","metric":"","refId":"A","step":240}],"title":"Read Amplification: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":18,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"connected","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sum(rocksdb_num_sstables{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name))","interval":"","intervalFactor":2,"legendFormat":"SSTables","refId":"A","step":120}],"timeFrom":null,"timeShift":null,"title":"RocksDB SSTables: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":19,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"dateFormat":"YYYY-MM-DD HH:mm:ss","pattern":"Time","type":"date"},{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"short"}],"targets":[{"expr":"sum(rocksdb_num_sstables{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name)","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","metric":"","refId":"A","step":240}],"title":"RocksDB SSTables: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"},{"collapse":false,"editable":true,"height":"250px","panels":[{"aliasColors":{},"bars":false,"datasource":"${DS_PROMETHEUS}","editable":true,"error":false,"fill":1,"grid":{"threshold1":null,"threshold1Color":"rgba(216, 200, 27, 0.27)","threshold2":null,"threshold2Color":"rgba(234, 112, 112, 0.22)"},"id":20,"isNew":true,"legend":{"avg":false,"current":false,"max":false,"min":false,"show":true,"total":false,"values":false},"lines":true,"linewidth":2,"links":[],"nullPointMode":"null as zero","percentage":false,"pointradius":5,"points":false,"renderer":"flot","seriesOverrides":[],"span":8,"stack":false,"steppedLine":false,"targets":[{"expr":"sum(sum(sys_fd_open{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name))","interval":"","intervalFactor":2,"legendFormat":"Open FDs","refId":"A","step":120},{"expr":"sum(sum(sys_fd_softlimit{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name))","intervalFactor":2,"legendFormat":"Limit","refId":"B","step":120}],"timeFrom":null,"timeShift":null,"title":"File Descriptors: $node","tooltip":{"msResolution":false,"shared":true,"sort":0,"value_type":"cumulative"},"type":"graph","xaxis":{"show":true},"yaxes":[{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true},{"format":"short","label":null,"logBase":1,"max":null,"min":null,"show":true}]},{"columns":[{"text":"Current","value":"current"},{"text":"Avg","value":"avg"},{"text":"Min","value":"min"},{"text":"Max","value":"max"}],"editable":true,"error":false,"fontSize":"90%","id":21,"isNew":true,"links":[],"pageSize":null,"scroll":true,"showHeader":true,"sort":{"col":0,"desc":true},"span":4,"styles":[{"colorMode":null,"colors":["rgba(245, 54, 54, 0.9)","rgba(237, 129, 40, 0.89)","rgba(50, 172, 45, 0.97)"],"decimals":2,"pattern":"/.*/","thresholds":[],"type":"number","unit":"percentunit"}],"targets":[{"expr":"sum(sys_fd_open{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name) / sum(sys_fd_softlimit{cluster=\"$cluster\",kubernetes_pod_node_name=~\"$node\"}) by (kubernetes_pod_node_name)","interval":"","intervalFactor":2,"legendFormat":"{{kubernetes_pod_node_name}}","refId":"A","step":240}],"title":"File descriptor usage: $node","transform":"timeseries_aggregations","type":"table"}],"title":"New row"}],"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"]},"templating":{"list":[{"current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":false,"label":"Cluster name","multi":false,"name":"cluster","options":[],"query":"sys_uptime","refresh":1,"regex":"/cluster=\"([^\"]+)\"/","type":"query"},{"allValue":".*","current":{},"datasource":"${DS_PROMETHEUS}","hide":0,"includeAll":true,"label":"Node","multi":false,"name":"node","options":[],"query":"label_values(sys_uptime{job=\"cockroach\",cluster=\"$cluster\"},kubernetes_pod_node_name)","refresh":1,"regex":"","type":"query"},{"current":{"selected":true,"text":"1m","value":"1m"},"datasource":null,"hide":0,"includeAll":false,"label":"Rate Interval","multi":false,"name":"rate_interval","options":[{"selected":false,"text":"30s","value":"30s"},{"selected":true,"text":"1m","value":"1m"},{"selected":false,"text":"5m","value":"5m"},{"selected":false,"text":"10m","value":"10m"},{"selected":false,"text":"30m","value":"30m"},{"selected":false,"text":"1h","value":"1h"},{"selected":false,"text":"6h","value":"6h"},{"selected":false,"text":"12h","value":"12h"},{"selected":false,"text":"1d","value":"1d"}],"query":"30s,1m,5m,10m,30m,1h,6h,12h,1d","refresh":0,"type":"interval"}]},"annotations":{"list":[]},"refresh":false,"schemaVersion":12,"version":15,"links":[{"asDropdown":true,"icon":"external link","includeVars":true,"keepTime":true,"tags":["cockroach"],"targetBlank":true,"title":"Dashboards","type":"dashboards"}],"gnetId":null},"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]} +{% endraw %} \ No newline at end of file diff --git a/roles/prometheus/templates/grafana-dashboards/http-service.json b/roles/prometheus/templates/grafana-dashboards/http-service.json new file mode 100644 index 0000000..d2fe2fc --- /dev/null +++ b/roles/prometheus/templates/grafana-dashboards/http-service.json @@ -0,0 +1,249 @@ +{% raw %} + +{ + "dashboard": { + "__inputs": [ + { + "name": "DS_PROMETHEUS", + "label": "prometheus", + "description": "", + "type": "datasource", + "pluginId": "prometheus", + "pluginName": "Prometheus" + } + ], + "__requires": [ + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "4.4.1" + }, + { + "type": "panel", + "id": "graph", + "name": "Graph", + "version": "" + }, + { + "type": "datasource", + "id": "prometheus", + "name": "Prometheus", + "version": "1.0.0" + } + ], + "annotations": { + "list": [] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 1, + "hideControls": false, + "id": null, + "links": [], + "rows": [ + { + "collapse": false, + "height": "250px", + "panels": [ + { + "aliasColors": {}, + "bars": false, + "dashLength": 10, + "dashes": false, + "datasource": "${DS_PROMETHEUS}", + "editable": true, + "error": false, + "fill": 1, + "grid": {}, + "id": 1, + "legend": { + "alignAsTable": true, + "avg": true, + "current": true, + "max": false, + "min": false, + "rightSide": true, + "show": true, + "total": false, + "values": true + }, + "lines": true, + "linewidth": 2, + "links": [], + "nullPointMode": "connected", + "percentage": false, + "pointradius": 5, + "points": false, + "renderer": "flot", + "seriesOverrides": [], + "spaceLength": 10, + "span": 12, + "stack": false, + "steppedLine": false, + "targets": [ + { + "expr": "(sum(rate(http_requests_total{job=\"kubernetes-service-endpoints\",status=~\"2..\",component=\"$component\"}[1m]))", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "2xx", + "metric": "container_memory_usage_bytes", + "refId": "A", + "step": 15 + }, + { + "expr": "(sum(rate(http_requests_total{job=\"kubernetes-service-endpoints\",status=~\"5..\",component=\"$component\"}[1m])) / sum(rate(http_requests_total{job=\"kubernetes-service-endpoints\",component=\"$component\"}[1m]))) * 100", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "5xx", + "metric": "kube_pod_container_resource_requests_memory_bytes", + "refId": "B", + "step": 20 + }, + { + "expr": "sum(rate(http_requests_total{job=\"kubernetes-service-endpoints\",component=\"$component\"}[1m]))", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "total", + "metric": "kube_pod_container_resource_requests_memory_bytes", + "refId": "B", + "step": 20 + } + ], + "thresholds": [], + "timeFrom": null, + "timeShift": null, + "title": "Request / error rate ", + "tooltip": { + "msResolution": true, + "shared": true, + "sort": 0, + "value_type": "cumulative" + }, + "type": "graph", + "xaxis": { + "buckets": null, + "mode": "time", + "name": null, + "show": true, + "values": [] + }, + "yaxes": [ + { + "format": "bytes", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + }, + { + "format": "short", + "label": null, + "logBase": 1, + "max": null, + "min": null, + "show": true + } + ] + } + ], + "repeat": null, + "repeatIteration": null, + "repeatRowId": null, + "showTitle": false, + "title": "Row", + "titleSize": "h6" + } + ], + "schemaVersion": 14, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "allValue": ".*", + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "hide": 0, + "includeAll": true, + "label": "Namespace", + "multi": false, + "name": "namespace", + "options": [], + "query": "label_values(http_request_duration_seconds_sum, kubernetes_namespace)", + "refresh": 1, + "regex": "", + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": null, + "current": {}, + "datasource": "${DS_PROMETHEUS}", + "hide": 0, + "includeAll": false, + "label": "HTTP service", + "multi": false, + "name": "component", + "options": [], + "query": "label_values(http_request_duration_seconds_sum{kubernetes_namespace=~\"$namespace\"}, component)", + "refresh": 1, + "regex": "", + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-6h", + "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": "HTTP service", + "version": 1 + }, + "overwrite": true, + "inputs": [ + { + "name": "DS_PROMETHEUS", + "type": "datasource", + "pluginId": "prometheus", + "value": "prometheus" + } + ] +} +{% endraw %} diff --git a/roles/prometheus/templates/grafana-dashboards/template.json b/roles/prometheus/templates/grafana-dashboards/template.json new file mode 100644 index 0000000..822c008 --- /dev/null +++ b/roles/prometheus/templates/grafana-dashboards/template.json @@ -0,0 +1,15 @@ +{% raw %} +{ + "dashboard": { + ... ... + }, + "overwrite": true, + "inputs": [ + { + "name": "DS_PROMETHEUS", + "type": "datasource", + "pluginId": "prometheus", + "value": "prometheus" + } + ] +}{% endraw %} \ No newline at end of file diff --git a/roles/prometheus/templates/grafana.yaml b/roles/prometheus/templates/grafana.yaml index 8877200..eb315ab 100644 --- a/roles/prometheus/templates/grafana.yaml +++ b/roles/prometheus/templates/grafana.yaml @@ -9,32 +9,7 @@ metadata: namespace: {{ k8s_prometheus_namespace }} name: prometheus-grafana data: - capacity-planning-dashboard.json: |- -{% include 'grafana-dashboards/capacity-planning.json' %} - - cluster-health-dashboard.json: |- -{% include 'grafana-dashboards/cluster-health.json' %} - - cluster-monitoring-dashboard.json: |- -{% include 'grafana-dashboards/cluster-monitoring.json' %} - - cluster-status-dashboard.json: |- -{% include 'grafana-dashboards/cluster-status.json' %} - - control-plane-status-dashboard.json: |- -{% include 'grafana-dashboards/control-plane-status.json' %} - - deployment-dashboard.json: |- -{% include 'grafana-dashboards/deployment.json' %} - - nodes-dashboard.json: |- -{% include 'grafana-dashboards/nodes.json' %} - - pods-dashboard.json: |- -{% include 'grafana-dashboards/pods.json' %} - - resource-requests-dashboard.json: |- -{% include 'grafana-dashboards/resource-requests.json' %} +{% include 'grafana-dashboards/all.yml' %} prometheus-datasource.json: |- { diff --git a/roles/prometheus/templates/scrape_configs/all.yml b/roles/prometheus/templates/scrape_configs/all.yml index c4018fa..a397e59 100644 --- a/roles/prometheus/templates/scrape_configs/all.yml +++ b/roles/prometheus/templates/scrape_configs/all.yml @@ -5,3 +5,7 @@ {% if k8s_prometheus_scrape_istio_metrics %} {% include 'scrape_configs/istio.yml' %} {% endif %} + +{% if k8s_prometheus_scrape_cockroachdb_metrics %} +{% include 'scrape_configs/cockroachdb.yml' %} +{% endif %} diff --git a/roles/prometheus/templates/scrape_configs/cockroachdb.yml b/roles/prometheus/templates/scrape_configs/cockroachdb.yml new file mode 100644 index 0000000..c7727a8 --- /dev/null +++ b/roles/prometheus/templates/scrape_configs/cockroachdb.yml @@ -0,0 +1,44 @@ + - job_name: 'cockroach' + + kubernetes_sd_configs: + - role: endpoints + + tls_config: + insecure_skip_verify: true + + relabel_configs: + - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape] + action: keep + regex: true + - source_labels: [__meta_kubernetes_pod_name] + action: keep + regex: cockroachdb-(\d+) + - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme] + action: replace + target_label: __scheme__ + regex: (https?) + - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path] + action: replace + target_label: __metrics_path__ + regex: (.+) + - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port] + action: replace + target_label: __address__ + regex: (.+)(?::\d+);(\d+) + replacement: $1:$2 + - source_labels: [__meta_kubernetes_pod_node_name] + action: replace + target_label: kubernetes_pod_node_name + - action: labelmap + regex: __meta_kubernetes_service_label_(.+) + - source_labels: [__meta_kubernetes_namespace] + action: replace + target_label: kubernetes_namespace + - source_labels: [__meta_kubernetes_pod_name] + action: replace + target_label: kubernetes_pod_name + - source_labels: [__address__] + action: replace + target_label: cluster + regex: (.+) + replacement: cockroachdb-cluster \ No newline at end of file diff --git a/roles/prometheus/templates/scrape_configs/kubernetes.yml b/roles/prometheus/templates/scrape_configs/kubernetes.yml index bffeb7a..08a5e8b 100644 --- a/roles/prometheus/templates/scrape_configs/kubernetes.yml +++ b/roles/prometheus/templates/scrape_configs/kubernetes.yml @@ -138,6 +138,12 @@ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape] action: keep regex: true +{% if k8s_prometheus_scrape_cockroachdb_metrics %} + + - source_labels: [__meta_kubernetes_pod_name] + action: drop + regex: cockroachdb-(\d+) +{% endif %} - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme] action: replace target_label: __scheme__