Branch: refs/heads/master
Home:
https://github.com/tribe29/checkmk
Commit: 1361c7e3e53b6b63a103b812fef6d5768618ea13
https://github.com/tribe29/checkmk/commit/1361c7e3e53b6b63a103b812fef6d5768…
Author: Solomon Jacobs <solomon.jacobs(a)tribe29.com>
Date: 2022-10-07 (Fri, 07 Oct 2022)
Changed paths:
A .werks/14562
M cmk/gui/plugins/wato/special_agents/prometheus.py
M cmk/special_agents/utils/prometheus.py
M tests/unit/cmk/special_agents/utils/test_prometheus.py
Log Message:
-----------
14562 FIX Prometheus: allow specifying a path prefix
Previously, the Prometheus special agent would use the path prefix as a
URL base prefix. For example, specifying the use of the host IP
address, e.g. `1.2.3.4`, together with a prefix, e.g., `my_prefix` would
result in an API call to
```
https://my_prefix1.2.3.4/api/v1/status/buildinfo
```
In particular, this behaviour deviated from the description in the
Prometheus rule. With this werk, the path prefix is prepended to the API
calls instead, e.g.,
```
https://1.2.3.4/my_prefix/api/v1/status/buildinfo
```
Users, which have specified a path prefix, are migrated to the new
option `Custom URL base prefix`, which has the same behaviour as the old
path prefix option.
CMK-11288
Change-Id: I7238475d36cc899e945c9676784c11dc4ee86930
Commit: 61f7bc242b41ec86a0e35268503974e22a4fd42c
https://github.com/tribe29/checkmk/commit/61f7bc242b41ec86a0e35268503974e22…
Author: Solomon Jacobs <solomon.jacobs(a)tribe29.com>
Date: 2022-10-07 (Fri, 07 Oct 2022)
Changed paths:
M cmk/special_agents/agent_prometheus.py
Log Message:
-----------
Prometheus: let the request library do the quoting
The request library already quotes query parameters, e.g.,
`/api/v1/query?query=up{instance="localhost:9090"}`
is converted to
`/api/v1/query?query=up%7Binstance%3D%22localhost:9090%22%7D`
Because of our extra quoting we instead have
`/api/v1/query?query=up%7Binstance%3D%22localhost%3A9090%22%7D`
Both calls are equivalent in Prometheus v1.0.0 and v2.38.0.
CMK-11288
Closes: #513
Change-Id: Iddc18a63f7d928e9ec462db54d5de593d2ce16df
Compare:
https://github.com/tribe29/checkmk/compare/45693d9dd6f8...61f7bc242b41