Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
8.11.1
-
None
Description
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):
"QUERY./select.requestTimes" "QUERY./select.local.requestTimes" "QUERY./select.distrib.requestTimes"
and the selection is done like:
$jq:core(requests_total, select(.key | endswith(".requestTimes")) | select (.value | type == "object"), count)
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:
$jq:core(requests_total, select(.key | endswith(".requestTimes") and (contains(".local.") or contains(".distrib.") | not)) | select (.value | type == "object"), count)
(assuming that we want the total requestTimes count).