I'm trying to send a complex query http://myserver:1234/api/v1/query?query=(sum(cluster_health{Component='kafka'}))/count(cluster_health{Component='kafka'})";
java.lang.IllegalArgumentException: Not enough variable values available to expand 'Component=\'kafka\''
I read about this Exception and found that
in Using RestTemplate in Spring. Exception- Not enough variables available to expand It was discussed to use POST to handle complex queries. How do I put the query in request body? I tried a few ways but always got bad data reply.
Using {sort} and define sort string with special characters How would that work with WebClient? I tried the following and it did not work.
String DPCOMP="{Component="kafka"}";
Mono responseMono = this.webClient.get() .uri(uriBuilder -> uriBuilder .queryParam("query", "(sum(sa_cluster_health{DPCOMP}))", DPCOMP) .build()) .retrieve() .bodyToMono(PrometheusResponse.class);
Thanks.