You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Matthew Biscocho (Jira)" <ji...@apache.org> on 2023/05/04 17:49:00 UTC

[jira] [Commented] (SOLR-16137) prometheus_exporter configuration generates duplicated values for 1 metric

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

Matthew Biscocho commented on SOLR-16137:
-----------------------------------------

I believe this was fixed with [SOLR-14401|https://issues.apache.org/jira/browse/SOLR-14401]

> 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
>          Components: contrib - prometheus-exporter
>    Affects Versions: 8.11.1
>            Reporter: César Fuentes
>            Priority: Minor
>              Labels: configuration, metrics, prometheus
>
> 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.10#820010)

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