Open nmamn opened 7 months ago
I have the same problem, any help on this?
I think this is due to k8s.io/client-go/util/jsonpath
doesn't allow regex in jsonpath.
We have solved this using Prometheus metric_relabel_configs
.
@nmamn , it should work like this:
path: "{ .healthCheck[*] }"
and prometheus.yml:
metric_relabel_configs:
- source_labels: [service]
action: drop
regex: "^(APP1|APPn|.*APPz.*)$"
Hi, I am trying to parse a simple json and to add a "AND" condition in my filter, but it seems to give me a syntax error.
let's say my json is
It seems I cannot put something like this in the config :
path: '{.healthCheck[?(@.service == "APP1" && @.status == "OK")]}'
I get an error in the logs :caller=collector.go:76 level=error msg="Failed to extract json objects for metric" err="unrecognized character in action: U+0026 '&'"
Am I missing something ? this syntax seems perfectly valid in jsonpath, if I test it in https://jsonpath.com/ it just perfectly works. Is it supported by this exporter ?
Many thanks,
Nicolas