Merge ~sajoupa/charm-telegraf:prometheus-client-default-port-9103 into charm-telegraf:master

Proposed by Laurent Sesquès
Status: Superseded
Proposed branch: ~sajoupa/charm-telegraf:prometheus-client-default-port-9103
Merge into: charm-telegraf:master
Prerequisite: ~sajoupa/charm-telegraf:split_prometheus_client_config
Diff against target: 34 lines (+4/-4)
2 files modified
src/reactive/telegraf.py (+2/-2)
src/tests/unit/test_telegraf.py (+2/-2)
Reviewer Review Type Date Requested Status
Haw Loeung +1 Approve
BootStack Reviewers Pending
Review via email: mp+397005@code.launchpad.net

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

Commit message

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

To post a comment you must log in.
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
Haw Loeung (hloeung) wrote :

LGTM

review: Approve (+1)

Unmerged commits

ea55458... by Laurent Sesquès

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

3c4a87e... by Laurent Sesquès

small fix: move flag changes to the right if stanza for config.changed

f550c15... by Laurent Sesquès

Split prometheus_client output config out of the main config file. Allow a prometheus-client relation to prometheus even if prometheus_output_port is set (and use that port in the relation).

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 e2c0874..92998c7 100644
3--- a/src/reactive/telegraf.py
4+++ b/src/reactive/telegraf.py
5@@ -1249,8 +1249,8 @@ def configure_prometheus_client_with_relation(prometheus):
6 port = get_prometheus_port()
7 else:
8 # We have a relation with prometheus, but removed the port number config.
9- # Default to 9126.
10- port = "9126"
11+ # Default to 9103.
12+ port = "9103"
13 # We'll iterate through the prometheus-client relation counterparts,
14 # inform them of our address so that they scrape it, and get their egress subnets
15 # so that we can allow them
16diff --git a/src/tests/unit/test_telegraf.py b/src/tests/unit/test_telegraf.py
17index 09e1575..9fcb1b3 100644
18--- a/src/tests/unit/test_telegraf.py
19+++ b/src/tests/unit/test_telegraf.py
20@@ -1094,14 +1094,14 @@ def test_prometheus_client_output(mocker, monkeypatch, config):
21 telegraf.configure_prometheus_client_with_relation(interface)
22 expected = """
23 [[outputs.prometheus_client]]
24- listen = ":9126"
25+ listen = ":9103"
26 """
27 assert (
28 configs_dir().join("prometheus_client.conf").read().strip() == expected.strip()
29 )
30 network_get_primary_address.assert_called_once_with("prometheus-client")
31 interface.configure.assert_called_once_with(
32- "9126", hostname="foo", private_address="foo"
33+ "9103", hostname="foo", private_address="foo"
34 )
35
36

Subscribers

People subscribed via source and target branches

to all changes: