TL;DR: Can beats/metricsbeat/prometheus module tolerate a config key that contains dots/periods/full-stops, given the Beats go-ucfg config-processsing.
I am using
metricbeat and module
prometheus. For the Prometheus scrape
GET, I need to include a queryString that includes dots in the parameter names. So an example config might be:
- module: prometheus period: 60s hosts: ["https://endpoint.with.https:443"] metricsets: ["query"] queries: - name: export path: /path/to/export params: foo.bar: baz username: "someuser" password: "somesecretpassword"
This results in a
GET request to the metrics endpoint of:
https://endpoint.with.https:443/path/to/export?foo=map%5Bbar%3Abaz%5D . Which is, decoded, a queryString of
foo=map[bar:baz], a mixed-up interpretation splitting the key into a key plus the start of a map.
I've made a bunch of attempts to fix this, including various quoting or escaping in the key, to no avail.
I assume that this relates to the way Beat's config module, which I believe is GitHub - elastic/go-ucfg: Golang universal configuration works? I think it has special support for config paths, with the detault path-separator ".", set I think at beats/config.go at e5bc6ea4ae514c2f9f68f733ceb427003da58363 · elastic/beats · GitHub .
Is there a way of escaping this, so I can have beats config keys containing a "."?
Looks like I might be suffering an issue similar to that reported in Beats configuration "dotted" keys issue · Issue #27079 · elastic/beats · GitHub ?
Thanks for any tips or workarounds for this.