Merge ~canonical-is-bootstack/charm-grafana:review/dmzoneill/fix-default-dsn into charm-grafana:master

Proposed by Alvaro Uria
Status: Merged
Approved by: Chris Sanders
Approved revision: e4365663d2a8c4ab7f6e7f8f51fa844d5672083a
Merged at revision: be37b3a77f68062f8a005877529cbcd6dd408499
Proposed branch: ~canonical-is-bootstack/charm-grafana:review/dmzoneill/fix-default-dsn
Merge into: charm-grafana:master
Diff against target: 73 lines (+23/-3)
4 files modified
src/README.md (+13/-0)
src/reactive/grafana.py (+8/-0)
src/tests/functional/tests/bundles/base.yaml (+2/-2)
src/wheelhouse.txt (+0/-1)
Reviewer Review Type Date Requested Status
Chris Sanders Approve
Drew Freiberger Approve
Review via email: mp+392669@code.launchpad.net

Commit message

Update data source relation to inject default values to support grafana 7 snap revision.

Additional fixes for functional testing and documentation of known issues in README.

To post a comment you must log in.
Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

Unable to determine commit message from repository - please click "Set commit message" and enter the commit message manually.

Revision history for this message
Drew Freiberger (afreiberger) wrote :

LGTM

review: Approve
Revision history for this message
Chris Sanders (chris.sanders) wrote :

LGTM +1

review: Approve
Revision history for this message
Canonical IS Mergebot (canonical-is-mergebot) wrote :

Change successfully merged at revision be37b3a77f68062f8a005877529cbcd6dd408499

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/README.md b/src/README.md
2index cb0ffb1..2b3e49c 100644
3--- a/src/README.md
4+++ b/src/README.md
5@@ -137,6 +137,19 @@ After modifying code, you must assemble the charm:
6 charm build
7 ```
8
9+## Known Issues
10+
11+* [LP#1901044](https://bugs.launchpad.net/charm-grafana/+bug/1901044): In `stable/20.10`,
12+ When deploying grafana, prometheus and prometheus-ceph-exporter
13+ for the first time, Grafana will check if Ceph related metrics exist in Prometheus.
14+ If such metrics don't exist at the time of adding the relation, the Ceph dashboards
15+ won't be imported. In order to fix this problem, the grafana:grafana-source relation
16+ should be recycled (`juju remove-relation grafana:grafana-source prometheus`,
17+ followed by `juju add-relation grafana:grafana-source prometheus`).
18+
19+* [LP#1901041](https://bugs.launchpad.net/charm-grafana/+bug/1901041): Xenial functional
20+ tests fail when changing Grafana's port via Juju config.
21+
22 ## Contact Information
23
24 Author: Alvaro Uria <alvaro.uria@canonical.com>, Jacek Nykis <jacek.nykis@canonical.com>
25diff --git a/src/reactive/grafana.py b/src/reactive/grafana.py
26index 51e5984..d6718eb 100644
27--- a/src/reactive/grafana.py
28+++ b/src/reactive/grafana.py
29@@ -985,6 +985,14 @@ def generate_query(ds, is_default, id=None, org_id=1):
30 # The 32 bit mask is necessary because Python's 64 bit ints are too
31 # large for SQLite3.
32 values.append(hash(ds["url"]) & 0xFFFFFFFF)
33+ # latest grafana will fail to accept the datasource
34+ # unless these fields are default as follows
35+ fields.append("json_data")
36+ values.append("{}")
37+ fields.append("secure_json_data")
38+ values.append("{}")
39+ fields.append("read_only")
40+ values.append(0)
41
42 # Used in connecting a mysql source
43 if "database" in ds:
44diff --git a/src/tests/functional/tests/bundles/base.yaml b/src/tests/functional/tests/bundles/base.yaml
45index 06454fa..6b4b218 100644
46--- a/src/tests/functional/tests/bundles/base.yaml
47+++ b/src/tests/functional/tests/bundles/base.yaml
48@@ -41,7 +41,7 @@ applications:
49 charm: cs:nrpe
50 num_units: 0
51 prometheus:
52- charm: cs:prometheus2
53+ charm: cs:~llama-charmers-next/prometheus2
54 num_units: 1
55 options:
56 label-juju-units: true
57@@ -50,7 +50,7 @@ applications:
58 options:
59 prometheus_output_port: default
60 prometheus-ceph-exporter:
61- charm: cs:prometheus-ceph-exporter
62+ charm: cs:~llama-charmers-next/prometheus-ceph-exporter
63 num_units: 1
64 prometheus-libvirt-exporter:
65 charm: cs:~llama-charmers-next/prometheus-libvirt-exporter
66diff --git a/src/wheelhouse.txt b/src/wheelhouse.txt
67index ebe0ec6..ffdadef 100644
68--- a/src/wheelhouse.txt
69+++ b/src/wheelhouse.txt
70@@ -1,3 +1,2 @@
71-setuptools
72 requests
73 jsondiff

Subscribers

People subscribed via source and target branches