Created
December 22, 2023 16:23
-
-
Save grafuls/e70a17ddfde98f5e446e1cc4d15aed07 to your computer and use it in GitHub Desktop.
Python generated grafana dashboards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from grafanalib.core import ( | |
Dashboard, Graph, | |
OPS_FORMAT, Row, | |
single_y_axis, Target | |
) | |
dashboard = Dashboard( | |
title="Python generated dashboard", | |
rows=[ | |
Row(panels=[ | |
Graph( | |
title="Prometheus http requests", | |
dataSource='default', | |
targets=[ | |
Target( | |
expr='rate(prometheus_http_requests_total[5m])', | |
legendFormat="{{ handler }}", | |
refId='A', | |
), | |
], | |
yAxes=single_y_axis(format=OPS_FORMAT), | |
), | |
]), | |
], | |
).auto_panel_ids() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment