interface-prometheus:master

Last commit made on 2020-10-19
Get this branch:
git clone -b master https://git.launchpad.net/interface-prometheus
Members of Prometheus Charmers can upload to this branch. Log in for directions.

Branch merges

Branch information

Name:
master
Repository:
lp:interface-prometheus

Recent commits

f476e31... by Drew Freiberger

Remove operator.py from reactive master branch

Reviewed-on: https://code.launchpad.net/~afreiberger/interface-prometheus/+git/interface-prometheus/+merge/392388
Reviewed-by: Alvaro Uria <email address hidden>
Reviewed-by: Stuart Bishop <email address hidden>

b3c2c38... by Drew Freiberger

Remove operator.py from reactive master branch

There is an issue with the reactive framework trying to import all *.py
files from hooks/relations to inspect for reactive state handlers.
operator.py being in this interface-layer's master branch breaks
deployment of newly built reactive charms using this interface.

https://github.com/juju-solutions/charms.reactive/issues/226

d960f00... by Joe Guo

operator.py: check state data before pass to unit

This help to avoid following errors while relation joined:

1)

our_unit_data["metrics_path"] = self.state.metrics_path
File "/var/lib/juju/agents/unit-cloudstats-1/charm/venv/ops/model.py", line 688, in __setitem__
raise RelationDataError('relation data values must be strings')

2)

  File "/var/lib/juju/agents/unit-cloudstats-1/charm/lib/interface_prometheus/operator.py", line 122, in _update_scrape_targets
    our_unit_data["labels"] = json.dumps(dict(self.state.labels))
TypeError: 'NoneType' object is not iterable
unit-cloudstats-1: 16:38:54 ERROR juju.worker.uniter.operation hook "prometheus-scrape-target-relation-joined" failed: exit status 1

Reviewed-on: https://code.launchpad.net/~guoqiao/interface-prometheus/+git/interface-prometheus/+merge/391495
Reviewed-by: Edin S <email address hidden>
Reviewed-by: Haw Loeung <email address hidden>

9c69dc2... by Joe Guo

operator.py: check state data before pass to unit

This help to avoid following errors while relation joined:

1)

our_unit_data["metrics_path"] = self.state.metrics_path
File "/var/lib/juju/agents/unit-cloudstats-1/charm/venv/ops/model.py", line 688, in __setitem__
raise RelationDataError('relation data values must be strings')

2)

  File "/var/lib/juju/agents/unit-cloudstats-1/charm/lib/interface_prometheus/operator.py", line 122, in _update_scrape_targets
    our_unit_data["labels"] = json.dumps(dict(self.state.labels))
TypeError: 'NoneType' object is not iterable
unit-cloudstats-1: 16:38:54 ERROR juju.worker.uniter.operation hook "prometheus-scrape-target-relation-joined" failed: exit status 1

Signed-off-by: Joe Guo <email address hidden>

afe6fbb... by Joe Guo

extract get_hostname method so we can monkeypatch it in test.

Currently tests in charm-cloudstats is broken, rely on this fix.

Reviewed-on: https://code.launchpad.net/~guoqiao/interface-prometheus/+git/interface-prometheus/+merge/391273
Reviewed-by: Paul Goins <email address hidden>
Reviewed-by: Edin S <email address hidden>

Merged branch ~guoqiao/interface-prometheus:extract_get_hostname
e37d041... by Joe Guo

add .gitignore to ignore __pycache__ dir

Reviewed-on: https://code.launchpad.net/~guoqiao/interface-prometheus/+git/interface-prometheus/+merge/391331
Reviewed-by: Paul Goins <email address hidden>
Reviewed-by: Edin S <email address hidden>

Merged branch ~guoqiao/interface-prometheus:gitignore
c638555... by Joe Guo

add .gitignore to ignore __pycache__ dir

Signed-off-by: Joe Guo <email address hidden>

7d09085... by Joe Guo

extract get_hostname method

So we can monkeypath it in test.

Signed-off-by: Joe Guo <email address hidden>

f91223b... by Andrea Ieri

Add operator module for PrometheusScrapeTarget interface

Reviewed-on: https://code.launchpad.net/~aieri/interface-prometheus/+git/interface-prometheus/+merge/390436
Reviewed-by: Drew Freiberger <email address hidden>
Reviewed-by: Chris Sanders <email address hidden>

21d5ff7... by Andrea Ieri

Address comments from MP#390436