Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
span=3,
steppedLine=True,
yAxes=G.YAxes(left=G.YAxis(format="short", decimals=0)),
),
W.prometheus.PromGraph(
data_source=PROMETHEUS_DATA_SOURCE,
title="Memory",
expressions=[
dict(expr=reduction('sum', metric(m, selection), selection),
legendFormat=title)
for m, title in [('mem_total', 'Used'),
('mem_limit', 'Available')]
],
span=3,
steppedLine=True,
yAxes=G.YAxes(left=G.YAxis(format=G.BYTES_FORMAT, decimals=0)),
),
W.prometheus.PromGraph(
data_source=PROMETHEUS_DATA_SOURCE,
title="Disk [PLACEHOLDER]",
expressions=[
dict(expr=reduction('sum', metric(m, selection), selection),
legendFormat=title)
for m, title in [('disk_used', 'Used'),
('disk_limit', 'Available')]
],
span=3,
steppedLine=True,
yAxes=G.YAxes(left=G.YAxis(format=G.BYTES_FORMAT, decimals=0)),
),
targets=[
d.Target(
expr='count(process_resident_memory_bytes{namespace="kube-system", job="kube-dns"}) by (job, namespace)'
)
],
nullPointMode="null",
),
d.Graph(
title="Service: memory usage",
targets=d.min_max_avg(
base='process_resident_memory_bytes{namespace="kube-system", job="kube-dns"}',
by=["job", "namespace"],
legend="{{job}}",
),
nullPointMode="null",
yAxes=g.single_y_axis(format=g.BYTES_FORMAT),
),
]
dashboard = d.Dashboard(
title="DNS",
rows=[
d.Row(title="In-cluster DNS prober", panels=PROBER_PANEL),
d.Row(title="In-cluster DNS service", panels=SERVICE_PANELS),
],
expr='sum(rate(container_cpu_usage_seconds_total{container!=""}[1m])) by (container, instance)',
legendFormat="{{instance}}: {{container}}",
),
d.Target(expr="machine_cpu_cores", legendFormat="limit"),
],
),
d.Graph(
title="memory usage by container",
targets=[
d.Target(
expr='sum(container_memory_usage_bytes{container!=""}) by (container, instance)',
legendFormat="{{instance}}: {{container}}",
),
d.Target(expr="machine_memory_bytes", legendFormat="limit"),
],
yAxes=g.single_y_axis(format=g.BYTES_FORMAT),
),
d.Graph(
title="memory working set by container",
targets=[
d.Target(
expr='sum(container_memory_working_set_bytes{container!=""}) by (container, instance)',
legendFormat="{{instance}}: {{container}}",
),
d.Target(expr="machine_memory_bytes", legendFormat="limit"),
],
yAxes=g.single_y_axis(format=g.BYTES_FORMAT),
),
d.Graph(
title="Network usage (bytes)",
targets=[
g.Target(
span=3,
steppedLine=True,
yAxes=G.YAxes(left=G.YAxis(format=G.BYTES_FORMAT, decimals=0)),
),
W.prometheus.PromGraph(
data_source=PROMETHEUS_DATA_SOURCE,
title="Disk [PLACEHOLDER]",
expressions=[
dict(expr=reduction('sum', metric(m, selection), selection),
legendFormat=title)
for m, title in [('disk_used', 'Used'),
('disk_limit', 'Available')]
],
span=3,
steppedLine=True,
yAxes=G.YAxes(left=G.YAxis(format=G.BYTES_FORMAT, decimals=0)),
),
targets=[
d.Target(
expr='count(container_memory_usage_bytes{namespace="probes", container="dns"}) by (container, namespace)'
)
],
nullPointMode="null",
),
d.Graph(
title="probe: memory usage",
targets=d.min_max_avg(
base='process_resident_memory_bytes{namespace="probes", job="dns"}',
by=["job", "namespace"],
legend="{{job}}",
),
nullPointMode="null",
yAxes=g.single_y_axis(format=g.BYTES_FORMAT),
),
]
SERVICE_PANELS = [
d.Graph(
title="Service: # running",
targets=[
d.Target(
expr='count(process_resident_memory_bytes{namespace="kube-system", job="kube-dns"}) by (job, namespace)'
)
],
nullPointMode="null",
),
d.Graph(
title="Service: memory usage",
targets=d.min_max_avg(