Skip to content

Commit 6dfa5f5

Browse files
author
Mihail Kirov
committed
feat: grafana dashboard
1 parent 2aca5a3 commit 6dfa5f5

File tree

6 files changed

+163
-0
lines changed

6 files changed

+163
-0
lines changed

crates/cli/src/docker_init.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ pub fn handle_docker_init(config_path: String, output_dir: String) -> eyre::Resu
209209
networks: Networks::Simple(vec![METRICS_NETWORK.to_owned()]),
210210
depends_on: DependsOnOptions::Simple(vec!["cb_prometheus".to_owned()]),
211211
environment: Environment::List(vec!["GF_SECURITY_ADMIN_PASSWORD=admin".to_owned()]),
212+
volumes: vec![Volumes::Simple("./grafana/dashboards:/etc/grafana/provisioning/dashboards".to_owned()), Volumes::Simple("./grafana/datasources:/etc/grafana/provisioning/datasources".to_owned())],
212213
// TODO: re-enable logging here once we move away from docker logs
213214
logging: Some(LoggingParameters { driver: Some("none".to_owned()), options: None }),
214215
..Service::default()

grafana/dashboards/dashboard.json

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"annotations": {
3+
"list": [
4+
{
5+
"builtIn": 1,
6+
"datasource": {
7+
"type": "grafana",
8+
"uid": "-- Grafana --"
9+
},
10+
"enable": true,
11+
"hide": true,
12+
"iconColor": "rgba(0, 211, 255, 1)",
13+
"name": "Annotations & Alerts",
14+
"type": "dashboard"
15+
}
16+
]
17+
},
18+
"description": "",
19+
"editable": true,
20+
"fiscalYearStartMonth": 0,
21+
"graphTooltip": 0,
22+
"links": [],
23+
"panels": [
24+
{
25+
"datasource": {
26+
"type": "prometheus",
27+
"uid": "PBFA97CFB590B2093"
28+
},
29+
"fieldConfig": {
30+
"defaults": {
31+
"color": {
32+
"mode": "palette-classic"
33+
},
34+
"custom": {
35+
"axisBorderShow": false,
36+
"axisCenteredZero": false,
37+
"axisColorMode": "text",
38+
"axisLabel": "",
39+
"axisPlacement": "auto",
40+
"barAlignment": 0,
41+
"drawStyle": "line",
42+
"fillOpacity": 0,
43+
"gradientMode": "none",
44+
"hideFrom": {
45+
"legend": false,
46+
"tooltip": false,
47+
"viz": false
48+
},
49+
"insertNulls": false,
50+
"lineInterpolation": "linear",
51+
"lineWidth": 1,
52+
"pointSize": 5,
53+
"scaleDistribution": {
54+
"type": "linear"
55+
},
56+
"showPoints": "auto",
57+
"spanNulls": false,
58+
"stacking": {
59+
"group": "A",
60+
"mode": "none"
61+
},
62+
"thresholdsStyle": {
63+
"mode": "off"
64+
}
65+
},
66+
"mappings": [],
67+
"thresholds": {
68+
"mode": "absolute",
69+
"steps": [
70+
{
71+
"color": "green",
72+
"value": null
73+
},
74+
{
75+
"color": "red",
76+
"value": 80
77+
}
78+
]
79+
}
80+
},
81+
"overrides": []
82+
},
83+
"gridPos": {
84+
"h": 19,
85+
"w": 24,
86+
"x": 0,
87+
"y": 0
88+
},
89+
"id": 1,
90+
"options": {
91+
"legend": {
92+
"calcs": [],
93+
"displayMode": "list",
94+
"placement": "bottom",
95+
"showLegend": true
96+
},
97+
"tooltip": {
98+
"mode": "single",
99+
"sort": "none"
100+
}
101+
},
102+
"targets": [
103+
{
104+
"datasource": {
105+
"type": "prometheus",
106+
"uid": "PBFA97CFB590B2093"
107+
},
108+
"disableTextWrap": false,
109+
"editorMode": "builder",
110+
"expr": "da_commit_signature_received{instance=\"cb_da_commit:10000\"}",
111+
"fullMetaSearch": false,
112+
"includeNullMetadata": true,
113+
"instant": false,
114+
"legendFormat": "__auto",
115+
"range": true,
116+
"refId": "A",
117+
"useBackend": false
118+
}
119+
],
120+
"title": "DA commit signatures received",
121+
"type": "timeseries"
122+
}
123+
],
124+
"refresh": "auto",
125+
"schemaVersion": 39,
126+
"tags": [],
127+
"templating": {
128+
"list": []
129+
},
130+
"time": {
131+
"from": "now-5m",
132+
"to": "now"
133+
},
134+
"timepicker": {},
135+
"timezone": "",
136+
"title": "DA commit signatures received",
137+
"uid": "adqnytscpwp34b",
138+
"version": 1,
139+
"weekStart": ""
140+
}

grafana/dashboards/dashboards.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: 1
2+
3+
providers:
4+
- name: 'default'
5+
orgId: 1
6+
folder: ''
7+
folderUid: ''
8+
type: file
9+
disableDeletion: false
10+
editable: true
11+
options:
12+
path: /etc/grafana/provisioning/dashboards
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: 1
2+
3+
datasources:
4+
- name: Prometheus
5+
type: prometheus
6+
access: proxy
7+
orgId: 1
8+
url: http://cb_prometheus:9090
9+
isDefault: true
10+
editable: true

scripts/build_local_images.sh

100644100755
File mode changed.

scripts/build_local_module.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)