forked from MattMacGillivray/grafanalib
-
Notifications
You must be signed in to change notification settings - Fork 1
/
example-cloudwatch.dashboard.py
37 lines (33 loc) · 1.08 KB
/
example-cloudwatch.dashboard.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
This is an exemplary Grafana board that uses a Cloudwatch datasource.
The graph shows the Average CPU utilization from an ASG named "frontend-asg"
"""
from grafanalib.core import *
from grafanalib.cloudwatch import CloudwatchTarget
dashboard = Dashboard(
title="Clowdwatch Stats",
rows=[
Row(panels=[
Graph(
title="Cloudwatch ASG",
dataSource='Cloudwatch',
targets=[
CloudwatchTarget(
dimensions={
"AutoScalingGroupName": "frontend-asg",
},
metricName="CPUUtilization",
namespace="AWS/EC2",
region="eu-west-1",
statistics=["Average"],
checkParams=True,
),
],
yAxes=G.YAxes(
YAxis(format=PERCENT_UNIT_FORMAT),
YAxis(format=SHORT_FORMAT),
),
),
]),
],
).auto_panel_ids()