Skip to content

Commit

Permalink
Upgrade grafana dashboards (#56)
Browse files Browse the repository at this point in the history
* Use patches for adding dashboards over configmaps

Individual configmaps were being used to add new dashboards into
grafana, requiring adding new mounts into the grafana pod. This
change introduces using a single configmap to store dashboards,
allowing for kustomize patches to be used to modify the configmap
and therefore the dashboards passed into grafana in a more
streamlined way.

Signed-off-by: Ryan Drew <[email protected]>

* Remove docker monitoring dashboards

Too outdated to be working with cadvisor, no metrics show. We need
something different.

Signed-off-by: Ryan Drew <[email protected]>

* Remove node-exporter dashboard json

This text is already stored in the included configmap, no reason
it should also exist in its own file here. If such a reason comes
up though, this change can be reverted.

Signed-off-by: Ryan Drew <[email protected]>

* Add dashboards for node-exporter and cilium v12

Signed-off-by: Ryan Drew <[email protected]>

* Add script to include new grafana dashboards

Signed-off-by: Ryan Drew <[email protected]>

* Mark dashboards as writable for editing

Signed-off-by: Ryan Drew <[email protected]>

* Capitalize Prometheus datasource name

A lot of dashboards use a default prometheus datasource name of
"Prometheus" over "prometheus". This commit does the
capitalization to make it easier to import dashboards in the
future, without having to go through the hassle of adjusting the
datasource if necessary.

Signed-off-by: Ryan Drew <[email protected]>

* Move node-exporter and cadvisor out of prom dir

It was once helpful to have these resources nested together to
let one kustomization file in the root apply all of them. This
has made it more difficult to test out changes to individual
components, as they were biased to be applied all-together
rather than individually.

Signed-off-by: Ryan Drew <[email protected]>

* Update grafana README

Signed-off-by: Ryan Drew <[email protected]>

Signed-off-by: Ryan Drew <[email protected]>
  • Loading branch information
learnitall authored Sep 24, 2022
1 parent 898378a commit b6c4a02
Show file tree
Hide file tree
Showing 26 changed files with 9,429 additions and 15,549 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 7 additions & 3 deletions kustomize/grafana/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# grafana

## dashboards
## Included Dashboards

* node-exporter: [grafana.com](https://grafana.com/grafana/dashboards/1860)
* docker monitoring: [grafana.com](https://grafana.com/grafana/dashboards/193)
* node-exporter [1860](https://grafana.com/grafana/dashboards/1860)
* Cilium v1.12 Operator Metrics [16612](https://grafana.com/grafana/dashboards/16612-cilium-operator/)
* Cilium v1.12 Agent Metrics [16611](https://grafana.com/grafana/dashboards/16611-cilium-metrics/)
* kube-state-metrics-v2 [13332](https://grafana.com/grafana/dashboards/13332-kube-state-metrics-v2/)

In these dashboards, old style graph panels have been upgraded to the newer time series panel type. Additionally, kube-state-metrics-v2 had its `cluster` variable removed to simplify setup (this can be revisited in the future as needed).
19 changes: 19 additions & 0 deletions kustomize/grafana/dashboard-provider.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# see https://grafana.com/docs/grafana/latest/administration/provisioning/
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboard-provider
data:
default.yaml: |-
apiVersion: 1
providers:
- name: default-provider
orgId: 1
folder: 'custom'
type: file
disableDeletion: true
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
19 changes: 4 additions & 15 deletions kustomize/grafana/dashboards.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
# see https://grafana.com/docs/grafana/latest/administration/provisioning/
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboards
data:
default.yaml: |-
apiVersion: 1
providers:
- name: default-provider
orgId: 1
folder: 'custom'
type: file
disableDeletion: true
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: true
labels:
app.kubernetes.io/name: grafana-dashboards
app.kubernetes.io/managed-by: scaffolding
data: {}
Loading

0 comments on commit b6c4a02

Please sign in to comment.