See https://github.com/prometheus/client_java#http:

"All HTTP expostion integrations support restricting which time series to
return using ?name[]= URL parameters."

It's just code that allows you to add "?name[]=metric_name_to_filter_by" to
the end of the /metrics URL, in case you don't want the client library to
return all metric names.

On Sun, May 17, 2020 at 8:55 PM Nipuni Chandimali <[email protected]>
wrote:

> I'm trying to understand the logic of the parseQuery() method in
> Prometheus HTTP Server (implemented in Java).
>
> protected static Set<String> parseQuery(String query) throws IOException {
>         Set<String> names = new HashSet<String>();
>         if (query != null) {
>             String[] pairs = query.split("&");
>             for (String pair : pairs) {
>                 int idx = pair.indexOf("=");
>                 if (idx != -1 && URLDecoder.decode(pair.substring(0, idx), 
> "UTF-8").equals("name[]")) {
>                     names.add(URLDecoder.decode(pair.substring(idx + 1), 
> "UTF-8"));
>                 }
>             }
>         }
>
>             return names;
>
>     }
>
> Can somebody explain what is the logic behind checking whether the decoded 
> URL sub string is equal to name[] ?
>
> Regards
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/prometheus-users/CAKHONj1oSTKYHj_FeNxfwK7MBXuo87hMv0Mjc59HDQHC4kwtPA%40mail.gmail.com
> <https://groups.google.com/d/msgid/prometheus-users/CAKHONj1oSTKYHj_FeNxfwK7MBXuo87hMv0Mjc59HDQHC4kwtPA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Julius Volz
PromLabs - promlabs.com

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/CAObpH5zap2jRfMe%3DJZoVj9%3DsTwsspWAVH%2BshHGjX-fbO7ni8ew%40mail.gmail.com.

Reply via email to