File tree 5 files changed +11
-8
lines changed
5 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,6 @@ resources:
57
57
mysql-router-image :
58
58
type : oci-image
59
59
description : OCI image for mysql-router
60
- upstream-source : ghcr.io/canonical/charmed-mysql@sha256:4a605458a09dc53feed91a0d81310dca267b2ac273ed7e1798bc4cb50c14fe68
60
+ upstream-source : ghcr.io/canonical/charmed-mysql@sha256:89b8305613f6ce94f78a7c9b4baedef78f2816fd6bc74c00f6607bc5e57bd8e6
61
61
assumes :
62
62
- k8s-api
Original file line number Diff line number Diff line change @@ -29,12 +29,13 @@ class ExporterConfig:
29
29
url : str
30
30
username : str
31
31
password : str
32
+ listen_port : str
32
33
33
34
34
35
class COSRelation :
35
36
"""Relation with the cos bundle."""
36
37
37
- _EXPORTER_PORT = "49152 "
38
+ _EXPORTER_PORT = "9152 "
38
39
HTTP_SERVER_PORT = "8443"
39
40
_METRICS_RELATION_NAME = "metrics-endpoint"
40
41
_LOGGING_RELATION_NAME = "logging"
@@ -86,6 +87,7 @@ def exporter_user_config(self) -> ExporterConfig:
86
87
url = f"https://127.0.0.1:{ self .HTTP_SERVER_PORT } " ,
87
88
username = self .MONITORING_USERNAME ,
88
89
password = self .get_monitoring_password (),
90
+ listen_port = self ._EXPORTER_PORT ,
89
91
)
90
92
91
93
@property
Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ def update_mysql_router_exporter_service(
161
161
startup = ops .pebble .ServiceStartup .ENABLED .value
162
162
163
163
environment = {
164
+ "MYSQLROUTER_EXPORTER_LISTEN_PORT" : config .listen_port ,
164
165
"MYSQLROUTER_EXPORTER_USER" : config .username ,
165
166
"MYSQLROUTER_EXPORTER_PASS" : config .password ,
166
167
"MYSQLROUTER_EXPORTER_URL" : config .url ,
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
112
112
unit_address = await get_unit_address (ops_test , unit .name )
113
113
114
114
try :
115
- requests .get (f"http://{ unit_address } :49152 /metrics" , stream = False )
115
+ requests .get (f"http://{ unit_address } :9152 /metrics" , stream = False )
116
116
except requests .exceptions .ConnectionError as e :
117
117
assert "[Errno 111] Connection refused" in str (e ), "❌ expected connection refused error"
118
118
else :
@@ -137,7 +137,7 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
137
137
wait = tenacity .wait_fixed (10 ),
138
138
):
139
139
with attempt :
140
- response = requests .get (f"http://{ unit_address } :49152 /metrics" , stream = False )
140
+ response = requests .get (f"http://{ unit_address } :9152 /metrics" , stream = False )
141
141
response .raise_for_status ()
142
142
assert (
143
143
"mysqlrouter_route_health" in response .text
@@ -156,7 +156,7 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
156
156
):
157
157
with attempt :
158
158
try :
159
- requests .get (f"http://{ unit_address } :49152 /metrics" , stream = False )
159
+ requests .get (f"http://{ unit_address } :9152 /metrics" , stream = False )
160
160
except requests .exceptions .ConnectionError as e :
161
161
assert "[Errno 111] Connection refused" in str (
162
162
e
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
161
161
):
162
162
with attempt :
163
163
try :
164
- requests .get (f"http://{ unit_address } :49152 /metrics" , stream = False )
164
+ requests .get (f"http://{ unit_address } :9152 /metrics" , stream = False )
165
165
except requests .exceptions .ConnectionError as e :
166
166
assert "[Errno 111] Connection refused" in str (
167
167
e
@@ -187,7 +187,7 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
187
187
wait = tenacity .wait_fixed (10 ),
188
188
):
189
189
with attempt :
190
- response = requests .get (f"http://{ unit_address } :49152 /metrics" , stream = False )
190
+ response = requests .get (f"http://{ unit_address } :9152 /metrics" , stream = False )
191
191
response .raise_for_status ()
192
192
assert (
193
193
"mysqlrouter_route_health" in response .text
@@ -222,7 +222,7 @@ async def test_exporter_endpoint(ops_test: OpsTest) -> None:
222
222
):
223
223
with attempt :
224
224
try :
225
- requests .get (f"http://{ unit_address } :49152 /metrics" , stream = False )
225
+ requests .get (f"http://{ unit_address } :9152 /metrics" , stream = False )
226
226
except requests .exceptions .ConnectionError as e :
227
227
assert "[Errno 111] Connection refused" in str (
228
228
e
You can’t perform that action at this time.
0 commit comments