cannot modify prometheus_client.listen via extra_options
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Telegraf Charm |
New
|
Undecided
|
Unassigned |
Bug Description
The charm tries to allow modifying outputs.
However, when I tried this, using the following command:
juju config telegraf extra_options=
prometheus_
listen: 10.131.59.185:9103'
The charm crashed as follows:
2022-06-08 04:42:12 WARNING config-changed File "/var/lib/
2022-06-08 04:42:12 WARNING config-changed elif int(listen.
2022-06-08 04:42:12 WARNING config-changed ValueError: invalid literal for int() with base 10: '9103"'
(Note the double-quote character after the four digit characters of 9103.)
This seems to be due to get_extra_configs's "JSONification": https:/
You can see below that `json.dumps` does indeed wrap the value in quotes:
>>> import json, yaml
>>> x = '''outputs:
... prometheus_client:
... listen: 10.131.59.185:9103
... '''
>>> y = yaml.full_load(x)
>>> y
{'outputs': {'prometheus_
>>> print(y[
10.131.59.185:9103
>>> print(json.
"10.131.
>>> _
This deployment is kind of weird, hence this weird configuration, but it would useful if it worked as it would allow me to get rid of some potentially expensive iptables on a high-traffic service.
summary: |
- cannot modify prometheus_client.listen via extra_configs + cannot modify prometheus_client.listen via extra_options |
description: | updated |