Merge ~sajoupa/charm-telegraf:misc-fixes into charm-telegraf:master

Proposed by Laurent Sesquès
Status: Superseded
Proposed branch: ~sajoupa/charm-telegraf:misc-fixes
Merge into: charm-telegraf:master
Prerequisite: ~sajoupa/charm-telegraf:add_ip_range_support
Diff against target: 30 lines (+3/-2)
1 file modified
src/reactive/telegraf.py (+3/-2)
Reviewer Review Type Date Requested Status
Haw Loeung +1 Approve
Paul Goins Needs Fixing
Review via email: mp+397009@code.launchpad.net

This proposal has been superseded by a proposal from 2021-02-18.

Commit message

small fixes: remove unneeded host.service_reload, add a debug log for configure_telegraf(), and remove un unneeded 'else:'

To post a comment you must log in.
Revision history for this message
Laurent Sesquès (sajoupa) wrote :

passes `make test`

Revision history for this message
Laurent Sesquès (sajoupa) wrote :
Revision history for this message
🤖 Canonical IS Merge Bot (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 Merge Bot (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
Paul Goins (vultaire) wrote :

I have a concern about a particular part I investigated for a different fix I did recently. I think this may introduce a regression.

review: Needs Fixing
Revision history for this message
Laurent Sesquès (sajoupa) wrote :

replied inline.

Revision history for this message
Laurent Sesquès (sajoupa) wrote :

> I have a concern about a particular part I investigated for a different fix I
> did recently. I think this may introduce a regression.
now fixed.

Revision history for this message
Haw Loeung (hloeung) wrote :

LGTM

review: Approve (+1)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Failed to merge change (unable to merge source repository due to conflicts), setting status to needs review.

Unmerged commits

df744b3... by Laurent Sesquès

configure_telegraf: keep host.service_reload(service) after configuring exec_metrics, as it'won't get caught by start_or_restart()

8f023f5... by Laurent Sesquès

small fixes: remove unneeded host.service_reload, add a debug log for configure_telegraf(), and remove un unneeded 'else:'

fde6022... by Laurent Sesquès

Add support for ip_range in the prometheus-client output plugin

ea55458... by Laurent Sesquès

when related with prometheus-client, if prometheus_output_port is unset, use :9103 by default instead of 9126

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/src/reactive/telegraf.py b/src/reactive/telegraf.py
2index f6240d6..b510dba 100644
3--- a/src/reactive/telegraf.py
4+++ b/src/reactive/telegraf.py
5@@ -334,8 +334,7 @@ def get_prometheus_port():
6 return False
7 if config.get("prometheus_output_port") == "default":
8 return 9103
9- else:
10- return int(config.get("prometheus_output_port"))
11+ return int(config.get("prometheus_output_port"))
12
13
14 def get_prometheus_ip_range():
15@@ -429,6 +428,7 @@ def update_sysstat_config_with_sdac_xall(path="/etc/sysstat/sysstat"):
16
17
18 def configure_telegraf(): # noqa: C901
19+ hookenv.log("Generating telegraf.conf", level=hookenv.DEBUG)
20 update_sysstat_config_with_sdac_xall()
21 config = hookenv.config()
22 context = config.copy()
23@@ -577,6 +577,7 @@ def configure_telegraf(): # noqa: C901
24 context=context,
25 )
26
27+ # Make sure that only the right service is enabled, then defer to start_or_restart()
28 for service in [DEB_SERVICE, SNAP_SERVICE]:
29 if service == get_service():
30 host.service_resume(service)

Subscribers

People subscribed via source and target branches

to all changes: