Skip to content

Commit

Permalink
Update Grafana to 5.0 beta. (istio#3540)
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue.

Update Grafana to 5.0 beta.

Grafana 5.0 includes a major UI update. Configuration of datasources
and dashboards is easly done via file. Dashboards have been imported
and re-exported to be on the latest schema. README and install config
updated.

See the promo video [here](https://www.youtube.com/watch?v=Izr0IBgoTZQ).
What's new  [here](http://docs.grafana.org/guides/whats-new-in-v5/).

Screenshot below
![grafana-5 0](https://user-images.githubusercontent.com/771387/36320417-ff9287bc-12fa-11e8-9e78-ccad22336435.png)
  • Loading branch information
jeffmendoza authored and istio-merge-robot committed Feb 21, 2018
1 parent 65dd56a commit f19c420
Show file tree
Hide file tree
Showing 17 changed files with 5,864 additions and 5,532 deletions.
23 changes: 5 additions & 18 deletions addons/grafana/Dockerfile.grafana
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
# starts graphana with Prometheus Datasource pre configured
# imports dashboard /grafana-dashboard.json from DASHBOARD_URL
from grafana/grafana:4.1.2
from grafana/grafana:5.0.0-beta2

RUN apt-get update
RUN apt-get install -y curl

# allow anonymous access
ENV GF_AUTH_DISABLE_LOGIN_FORM=true
ENV GF_AUTH_ANONYMOUS_ENABLED=true
ENV GF_AUTH_ANONYMOUS_ORG_ROLE=Admin

COPY ./start.sh /start.sh
COPY ./grafana-dashboard.json /grafana-dashboard.json
COPY ./mixer-dashboard.json /mixer-dashboard.json
COPY ./pilot-dashboard.json /pilot-dashboard.json
COPY ./import_dashboard.sh ./import_dashboard.sh

ENTRYPOINT ["/start.sh"]
COPY grafana.ini /etc/grafana/
COPY dashboards.yaml /etc/grafana/provisioning/dashboards/
COPY datasources.yaml /etc/grafana/provisioning/datasources/
COPY dashboards /var/lib/grafana/dashboards/
29 changes: 23 additions & 6 deletions addons/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,28 @@ This dashboard focuses on

## Implementation details

[`start.sh`](start.sh) is the entrypoint, and it runs
[`import_dashboard.sh`](import_dashboard.sh) in the background then
starts Grafana. `import_dashboard.sh` POSTs the included dashboards
and Prometheus data-source config to Grafana once it starts up.
Grafana config is stored in
[`grafana.ini`](grafana.ini). [`dashboards.yaml`](dashboards.yaml) and
[`datasources.yaml`](datasources.yaml) configure those resources
respectively using the
[provisioning](http://docs.grafana.org/administration/provisioning/)
config.

A few env vars are set in the [Dockerfile](Dockerfile) to configure
Grafana, and more environment-specific ones are set in the [install
Provisioning is currently a new feature, so dashboards require a small
modification. Normally when exporting a dashboard from Grafana, the
datasources are templated, and then Grafana un-templates on import by
matching to an existing datasource. When using Provisioning this
doesn't happen, so this needs to be done manually.

The name of the configured datasource in `datasources.yaml` is
`Prometheus`, so all instances of `${DS_PROMETHEUS}` in exported
dashboards need to be replaced with
`Prometheus`. [`fix_datasources.sh`](fix_datasources.sh) accomplishes
this. Grafana is expected to fix this issue in the near future.

Another modification to dashboards is the `"uid"` field. This is
hard-coded instead of using the randomly generated one. This is to
allow easy direct hyperlinks to dashboards.

Environment-specific config is set in the [install
config](/install/kubernetes/templates/addons/grafana.yaml.tmpl).
6 changes: 6 additions & 0 deletions addons/grafana/dashboards.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- name: 'default'
org_id: 1
folder: ''
type: file
options:
folder: /var/lib/grafana/dashboards
Loading

0 comments on commit f19c420

Please sign in to comment.