Merge ~karimsye/charm-grafana:k8s-model-filter-template into ~prometheus-charmers/charm-grafana:master
Status: | Work in progress |
---|---|
Proposed branch: | ~karimsye/charm-grafana:k8s-model-filter-template |
Merge into: | ~prometheus-charmers/charm-grafana:master |
Diff against target: |
562 lines (+127/-6) 2 files modified
reactive/grafana.py (+2/-1) templates/dashboards/prometheus/Telegraf.json.j2 (+125/-5) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alvaro Uria (community) | Needs Fixing | ||
Xav Paice (community) | Needs Fixing | ||
Stuart Bishop (community) | is-reviews | Approve | |
Chris Sanders (community) | Needs Information | ||
BootStack Reviewers | mr tracking; do not claim | Pending | |
BootStack Reviewers | Pending | ||
BootStack Reviewers | Pending | ||
Review via email: mp+366501@code.launchpad.net |
Commit message
Add variables to filter k8s clusters by model
Added juju_model variable to Telegraf.json.j2 dashboard template for
filtering k8s clusters by model name. Also renamed "non-juju hosts"
variable to host, and set its value to hostnames that are part of the
selected juju_model variable. Also added {% raw %} and {% endraw %} to
escape jinja's '{{ }}' syntax. This enables the legendFormat variable
to properly display varables such as host.
Description of the change
Add variables to filter k8s clusters by model
Added juju_model variable to Telegraf.json.j2 dashboard template for
filtering k8s clusters by model name. Also renamed "non-juju hosts"
variable to host, and set its value to hostnames that are part of the
selected juju_model variable. Also added {% raw %} and {% endraw %} to
escape jinja's '{{ }}' syntax. This enables the legendFormat variable
to properly display varables such as host.
Example Prometheus target metrics can be found here:
- https:/
- https:/
- https:/
The 'juju_model' variable was derived by using the following in Grafana:
- Query: system_load1{}
- Regex: .*host="([^:]+).*$
The 'non-juju hosts' variable was changed to host and derived using the following in Grafana:
- Query: system_
- Regex: .*host="([^"]+).*
Both variables support multi-value and auto include all selection options.
I also added {% raw %} and {% endraw %} to escape jinja's '{{ }}' syntax.
For example, Jinja will evaluate {{host}} as "" and when the dashboard is imported, it will not render {{host}} in the legend section of the graphs. The escaping enables the "legendFormat" variable to properly display variables such as {{host}} and {{interface}}.
This merge proposal is being monitored by mergebot. Change the status to Approved to merge.