Implement pull request comments #200.
Co-authored-by: Sebastian Serth <mrserth@users.noreply.github.com>
This commit is contained in:
53
deploy/grafana-dashboard/panels/availability_row.py
Normal file
53
deploy/grafana-dashboard/panels/availability_row.py
Normal file
@ -0,0 +1,53 @@
|
||||
from grafanalib.core import RowPanel, BarGauge, GridPos, TimeSeries, ORIENTATION_VERTICAL, \
|
||||
GAUGE_DISPLAY_MODE_BASIC
|
||||
from grafanalib.influxdb import InfluxDBTarget
|
||||
|
||||
from utils.utils import read_query
|
||||
|
||||
prewarming_pool_size = BarGauge(
|
||||
title="Prewarming Pool Size",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("prewarming-pool-size"))],
|
||||
gridPos=GridPos(h=10, w=11, x=0, y=3),
|
||||
allValues=True,
|
||||
orientation=ORIENTATION_VERTICAL,
|
||||
displayMode=GAUGE_DISPLAY_MODE_BASIC,
|
||||
max=None,
|
||||
)
|
||||
|
||||
idle_runner = TimeSeries(
|
||||
title="Idle Runner",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("idle-runner"))],
|
||||
gridPos=GridPos(h=10, w=13, x=11, y=3),
|
||||
lineInterpolation="stepAfter",
|
||||
maxDataPoints=None
|
||||
)
|
||||
|
||||
runner_startup_duration = TimeSeries(
|
||||
title="Runner startup duration",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("runner-startup-duration"))],
|
||||
gridPos=GridPos(h=10, w=12, x=0, y=13),
|
||||
unit="ns",
|
||||
)
|
||||
|
||||
used_runner = TimeSeries(
|
||||
title="Used Runner",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("used-runner"))],
|
||||
gridPos=GridPos(h=10, w=12, x=12, y=13),
|
||||
maxDataPoints=None
|
||||
)
|
||||
|
||||
availability_row = RowPanel(
|
||||
title="Availability",
|
||||
collapsed=True,
|
||||
gridPos=GridPos(h=1, w=24, x=0, y=2),
|
||||
panels=[
|
||||
prewarming_pool_size,
|
||||
idle_runner,
|
||||
runner_startup_duration,
|
||||
used_runner
|
||||
]
|
||||
)
|
116
deploy/grafana-dashboard/panels/general_row.py
Normal file
116
deploy/grafana-dashboard/panels/general_row.py
Normal file
@ -0,0 +1,116 @@
|
||||
from grafanalib.core import RowPanel, GridPos, Stat, TimeSeries, Heatmap, BarGauge, GAUGE_DISPLAY_MODE_GRADIENT, \
|
||||
ORIENTATION_VERTICAL, GAUGE_DISPLAY_MODE_BASIC
|
||||
from grafanalib.influxdb import InfluxDBTarget
|
||||
|
||||
from utils.color_mapping import grey_all_mapping
|
||||
from utils.utils import read_query
|
||||
|
||||
requests_per_minute = TimeSeries(
|
||||
title="Requests per minute",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("requests-per-minute"))],
|
||||
gridPos=GridPos(h=9, w=8, x=0, y=1),
|
||||
scaleDistributionType="log",
|
||||
extraJson=grey_all_mapping
|
||||
)
|
||||
|
||||
request_latency = Heatmap(
|
||||
title="Request Latency",
|
||||
dataSource='Poseidon',
|
||||
dataFormat="timeseries",
|
||||
targets=[InfluxDBTarget(query=read_query("request-latency"))],
|
||||
gridPos=GridPos(h=9, w=8, x=8, y=1),
|
||||
maxDataPoints=None,
|
||||
extraJson={
|
||||
"options": {},
|
||||
"yAxis": {
|
||||
"format": "ns"
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
service_time = TimeSeries(
|
||||
title="Service time (99.9%)",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("service-time"))],
|
||||
gridPos=GridPos(h=9, w=8, x=16, y=1),
|
||||
scaleDistributionType="log",
|
||||
scaleDistributionLog=10,
|
||||
unit="ns",
|
||||
maxDataPoints=None
|
||||
)
|
||||
|
||||
current_environment_count = Stat(
|
||||
title="Current environment count",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("current-environment-count"))],
|
||||
gridPos=GridPos(h=6, w=8, x=0, y=10),
|
||||
alignment='center'
|
||||
)
|
||||
|
||||
currently_used_runners = Stat(
|
||||
title="Currently used runners",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("currently-used-runners"))],
|
||||
gridPos=GridPos(h=6, w=8, x=8, y=10),
|
||||
alignment="center"
|
||||
)
|
||||
|
||||
number_of_executions = BarGauge(
|
||||
title="Number of Executions",
|
||||
dataSource="Poseidon",
|
||||
targets=[InfluxDBTarget(query=read_query("number-of-executions"))],
|
||||
gridPos=GridPos(h=6, w=8, x=16, y=10),
|
||||
allValues=True,
|
||||
orientation=ORIENTATION_VERTICAL,
|
||||
displayMode=GAUGE_DISPLAY_MODE_BASIC,
|
||||
max=None,
|
||||
)
|
||||
|
||||
execution_duration = BarGauge(
|
||||
title="Execution duration",
|
||||
dataSource="Poseidon",
|
||||
targets=[InfluxDBTarget(query=read_query("execution-duration"))],
|
||||
gridPos=GridPos(h=11, w=8, x=0, y=16),
|
||||
allValues=True,
|
||||
displayMode=GAUGE_DISPLAY_MODE_GRADIENT,
|
||||
format="ns",
|
||||
max=None,
|
||||
)
|
||||
|
||||
executions_per_runner = BarGauge(
|
||||
title="Executions per runner",
|
||||
dataSource="Poseidon",
|
||||
targets=[InfluxDBTarget(query=read_query("executions-per-runner"))],
|
||||
gridPos=GridPos(h=11, w=8, x=8, y=16),
|
||||
allValues=True,
|
||||
displayMode=GAUGE_DISPLAY_MODE_GRADIENT,
|
||||
max=None,
|
||||
)
|
||||
|
||||
executions_per_minute = BarGauge(
|
||||
title="Executions per minute",
|
||||
dataSource="Poseidon",
|
||||
targets=[InfluxDBTarget(query=read_query("executions-per-minute"))],
|
||||
gridPos=GridPos(h=11, w=8, x=16, y=16),
|
||||
allValues=True,
|
||||
displayMode=GAUGE_DISPLAY_MODE_GRADIENT,
|
||||
max=None,
|
||||
)
|
||||
|
||||
general_row = RowPanel(
|
||||
title="General",
|
||||
collapsed=True,
|
||||
gridPos=GridPos(h=1, w=24, x=0, y=0),
|
||||
panels=[
|
||||
requests_per_minute,
|
||||
request_latency,
|
||||
service_time,
|
||||
current_environment_count,
|
||||
currently_used_runners,
|
||||
number_of_executions,
|
||||
execution_duration,
|
||||
executions_per_runner,
|
||||
executions_per_minute
|
||||
]
|
||||
)
|
25
deploy/grafana-dashboard/panels/poseidon.dashboard.py
Normal file
25
deploy/grafana-dashboard/panels/poseidon.dashboard.py
Normal file
@ -0,0 +1,25 @@
|
||||
from grafanalib.core import Dashboard, Templating, Time
|
||||
|
||||
from panels.availability_row import availability_row
|
||||
from panels.general_row import general_row
|
||||
from panels.runner_insights_row import runner_insights_row
|
||||
from utils.variables import stage_variable, environment_variable
|
||||
|
||||
dashboard = Dashboard(
|
||||
title="Poseidon autogen",
|
||||
timezone="browser",
|
||||
panels=[
|
||||
general_row,
|
||||
runner_insights_row,
|
||||
availability_row
|
||||
],
|
||||
templating=Templating(list=[
|
||||
stage_variable,
|
||||
environment_variable
|
||||
]),
|
||||
editable=True,
|
||||
refresh="30s",
|
||||
time=Time('now-6h', 'now'),
|
||||
uid="P21Bh1SVk",
|
||||
version=1
|
||||
).auto_panel_ids()
|
70
deploy/grafana-dashboard/panels/runner_insights_row.py
Normal file
70
deploy/grafana-dashboard/panels/runner_insights_row.py
Normal file
@ -0,0 +1,70 @@
|
||||
from grafanalib.core import RowPanel, GridPos, Histogram, TimeSeries
|
||||
from grafanalib.influxdb import InfluxDBTarget
|
||||
|
||||
from utils.utils import read_query
|
||||
|
||||
execution_duration_extra_json = {
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"unit": "ns"
|
||||
}
|
||||
}
|
||||
}
|
||||
execution_duration = Histogram(
|
||||
title="Execution duration",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("execution-duration-hist"))],
|
||||
gridPos=GridPos(h=8, w=24, x=0, y=2),
|
||||
bucketSize=100000000,
|
||||
colorMode="palette-classic",
|
||||
maxDataPoints=None,
|
||||
extraJson=execution_duration_extra_json
|
||||
)
|
||||
|
||||
executions_per_runner = Histogram(
|
||||
title="Executions per runner",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("executions-per-runner-hist"))],
|
||||
gridPos=GridPos(h=10, w=11, x=0, y=10),
|
||||
bucketSize=1,
|
||||
colorMode="palette-classic",
|
||||
)
|
||||
|
||||
executions_per_minute = TimeSeries(
|
||||
title="Executions per minute",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("executions-per-minute-time"))],
|
||||
gridPos=GridPos(h=10, w=13, x=11, y=10),
|
||||
maxDataPoints=None
|
||||
)
|
||||
|
||||
request_body_size = TimeSeries(
|
||||
title="Request Body Size",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("request-body-size"))],
|
||||
gridPos=GridPos(h=10, w=11, x=0, y=20),
|
||||
scaleDistributionType="log",
|
||||
unit="bytes",
|
||||
maxDataPoints=None
|
||||
)
|
||||
|
||||
runner_per_minute = TimeSeries(
|
||||
title="Runner per minute",
|
||||
dataSource='Poseidon',
|
||||
targets=[InfluxDBTarget(query=read_query("runner-per-minute"))],
|
||||
gridPos=GridPos(h=10, w=13, x=11, y=20),
|
||||
maxDataPoints=None
|
||||
)
|
||||
|
||||
runner_insights_row = RowPanel(
|
||||
title="Runner Insights",
|
||||
collapsed=True,
|
||||
gridPos=GridPos(h=1, w=24, x=0, y=1),
|
||||
panels=[
|
||||
execution_duration,
|
||||
executions_per_runner,
|
||||
executions_per_minute,
|
||||
request_body_size,
|
||||
runner_per_minute
|
||||
]
|
||||
)
|
Reference in New Issue
Block a user