Skip to content

Commit

Permalink
updated cockroachd scrape configs, added grafana dashboards in promet…
Browse files Browse the repository at this point in the history
…heus role
  • Loading branch information
vsaveliev committed Nov 29, 2017
1 parent 8ea0cb5 commit aeb3874
Show file tree
Hide file tree
Showing 12 changed files with 376 additions and 27 deletions.
2 changes: 1 addition & 1 deletion roles/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
{
Expand Down
44 changes: 44 additions & 0 deletions roles/prometheus/templates/grafana-dashboards/all.yml
Original file line number Diff line number Diff line change
@@ -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 %}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -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 %}
Loading

0 comments on commit aeb3874

Please sign in to comment.