Grafana as Code
Transfer our dashboard into a code representation via grafanalib.
This commit is contained in:
21
deploy/grafana-dashboard/color_mapping.py
Normal file
21
deploy/grafana-dashboard/color_mapping.py
Normal file
@@ -0,0 +1,21 @@
|
||||
def color_mapping(name, color):
|
||||
return {
|
||||
"fieldConfig": {
|
||||
"overrides": [{
|
||||
"matcher": {
|
||||
"id": "byName",
|
||||
"options": name
|
||||
},
|
||||
"properties": [{
|
||||
"id": "color",
|
||||
"value": {
|
||||
"fixedColor": color,
|
||||
"mode": "fixed"
|
||||
}
|
||||
}]
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
grey_all_mapping = color_mapping("all", "#4c4b5a")
|
Reference in New Issue
Block a user