[ 
https://issues.apache.org/jira/browse/SOLR-15564?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17389951#comment-17389951
 ] 

Andrzej Bialecki commented on SOLR-15564:
-----------------------------------------

This patch adds support for  {{expr}} filtering, which is essentially the same 
as the {{key}} but it supports regex expressions in each part of the key.

For example, where previously it was basically impossible to select just a 
subset of per-core metrics without knowing the core names now you can do it as 
follows:
{code:java}
http://localhost:8983/solr/admin/metrics?expr=solr\.core\..*:QUERY\..*\.requestTimes:.*Rate
 {code}
This expression selects metrics from any replica located on the node, and 
returns only the 1-, 5, 15-min request rates for QUERY handlers.

This implementation is fully back-compatible because it uses a different 
parameter name than the existing ones. Similarly to the {{key}} parameter, when 
{{expr}} is used any other filtering parameters are ignored.

If there are no objections I'll commit this shortly. I'm also planning to 
back-port this to 8x.

> Improve filtering expressions in /admin/metrics
> -----------------------------------------------
>
>                 Key: SOLR-15564
>                 URL: https://issues.apache.org/jira/browse/SOLR-15564
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Andrzej Bialecki
>            Assignee: Andrzej Bialecki
>            Priority: Major
>         Attachments: SOLR-15564.patch
>
>
> There are currently several ways to filter what metrics should be returned by 
> /admin/metrics but they have one important limitation: all types of filtering 
> criteria (group, type, prefix, regex, key) use implicit OR, so it's only ever 
> possible to broaden the filters but not to narrow them down.
> This issue came up while I was reviewing the default Prometheus exporter 
> config and I noticed that it pulls ALL metrics. This is extremely wasteful 
> and puts unnecessary load on the nodes, especially since only some of the 
> metrics are then used, either by the exporter itself or by the default 
> dashboard. In addition to that, the exporter needs to build an object tree 
> from all these metrics in order to apply the export rules, which leads to 
> excessive memory / cpu consumption in the reporter process.
> We should come up with a way to make these filters more expressive so that 
> it's possible e.g. to select only some metrics from a particular registry.
> The simplest way to implement this would be to extend the syntax of the 
> {{key}} parameter to support regex expressions in the parts of the key that 
> specify the metric name and the property name.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to