Implement pull request comments #200.

Co-authored-by: Sebastian Serth <mrserth@users.noreply.github.com>
This commit is contained in:
Maximilian Paß
2022-10-29 19:36:25 +01:00
parent 694965b92d
commit 137e3ff1ee
10 changed files with 32 additions and 22 deletions

View 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")

View File

@ -0,0 +1,4 @@
def read_query(name):
with open("queries/" + name + ".flux", 'r') as file:
return file.read()

View File

@ -0,0 +1,25 @@
from grafanalib.core import Template
from utils.utils import read_query
stage_variable = Template(
dataSource="Poseidon",
label="Stage",
name="stages",
query=read_query("stages"),
refresh=1,
includeAll=True,
multi=True,
default="production"
)
environment_variable = Template(
dataSource="Poseidon",
label="Environment IDs",
name="environment_ids",
query=read_query("environment-ids"),
refresh=1,
includeAll=True,
multi=True,
default="$__all"
)