César Fuentes created SOLR-16137:
------------------------------------

             Summary: prometheus_exporter configuration generates duplicated 
values for 1 metric
                 Key: SOLR-16137
                 URL: https://issues.apache.org/jira/browse/SOLR-16137
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: contrib - prometheus-exporter
    Affects Versions: 8.11.1
            Reporter: César Fuentes


The prometheus-exporter comes with a default configuration in the file 
`solr_exporter_config.xml`. It seems that the `jq` configuration to parse 
metrics from Solr to Prometheus has a small bug for one metric:

In the selection done for `solr_metrics_core_requests_total`, the condition 
assumes that there will be 1 result, but there are actually 3 because there are 
these paths in the JSON (for a given core):
{code:java}
"QUERY./select.requestTimes"
"QUERY./select.local.requestTimes"
"QUERY./select.distrib.requestTimes"{code}
and the selection is done like:
{code:java}
$jq:core(requests_total, select(.key | endswith(".requestTimes")) | select 
(.value | type == "object"), count) {code}
The generated Prometheus metrics have the same name and set of labels, thus 
they are identical for Prometheus and trigger a "duplicated metric" error 
further in the processing.

 

A simple solution is to fix the select condition, like:
{code:java}
$jq:core(requests_total, select(.key | endswith(".requestTimes") and 
(contains(".local.") or contains(".distrib.") | not)) | select (.value | type 
== "object"), count) {code}
(assuming that we want the _total_ requestTimes count).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

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

Reply via email to