Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-14401: Add back in missing metric and fix graphana dashboard (#770)

Houston Putman96650fbbc635
diff --git a/solr/docker/tests/cases/prometheus-exporter/test.sh b/solr/docker/tests/cases/prometheus-exporter/test.sh
index 0aa01b1f03c..76a972fcfc8 100755
--- a/solr/docker/tests/cases/prometheus-exporter/test.sh
+++ b/solr/docker/tests/cases/prometheus-exporter/test.sh
@@ -41,7 +41,7 @@ docker exec --user=solr "${container_name}-solr" wget -q -O - 'http://localhost:
echo "Checking prometheus data"
data=$(docker exec --user=solr "$container_name" wget -q -O - 'http://localhost:8989/metrics')
-if ! grep -E -q 'solr_metrics_core_requests_total{category="QUERY",handler="/select",internal="false",core="demo",base_url="http://solr-host:8983/solr",} [0-9]+.0' <<<"$data"; then
+if ! grep -E -q 'solr_metrics_core_query_requests_total{category="QUERY",searchHandler="/select",internal="false",core="demo",base_url="http://solr-host:8983/solr",} [0-9]+.0' <<<"$data"; then
echo "Test $TEST_NAME $tag failed; did not find correct data"
echo "$data"
exit 1
diff --git a/solr/prometheus-exporter/conf/grafana-solr-dashboard.json b/solr/prometheus-exporter/conf/grafana-solr-dashboard.json
index 172a6e5e3ff..4f709c17562 100644
--- a/solr/prometheus-exporter/conf/grafana-solr-dashboard.json
+++ b/solr/prometheus-exporter/conf/grafana-solr-dashboard.json
@@ -1501,7 +1501,7 @@
"steppedLine": false,
"targets": [
{
- "expr": "increase(solr_metrics_core_query_local_count{internal!=\"false\",base_url=~\"$base_url\",collection=~\"$collection\",shard=~\"$shard\",replica=~\"$replica\",core=~\"$core\",searchHandler=~\"$searchHandler\"}[1m])",
+ "expr": "increase(solr_metrics_core_query_requests_total{internal!=\"false\",base_url=~\"$base_url\",collection=~\"$collection\",shard=~\"$shard\",replica=~\"$replica\",core=~\"$core\",searchHandler=~\"$searchHandler\"}[1m])",
"format": "time_series",
"instant": false,
"interval": "",
@@ -1603,7 +1603,7 @@
"steppedLine": false,
"targets": [
{
- "expr": "solr_metrics_core_query_local_1minRate{internal!=\"false\",base_url=~\"$base_url\",collection=~\"$collection\",shard=~\"$shard\",replica=~\"$replica\",core=~\"$core\",searchHandler=~\"$searchHandler\"}",
+ "expr": "solr_metrics_core_query_1minRate{internal!=\"false\",base_url=~\"$base_url\",collection=~\"$collection\",shard=~\"$shard\",replica=~\"$replica\",core=~\"$core\",searchHandler=~\"$searchHandler\"}",
"format": "time_series",
"instant": false,
"interval": "",
@@ -1705,7 +1705,7 @@
"steppedLine": false,
"targets": [
{
- "expr": "solr_metrics_core_query_local_p95_ms{internal!=\"false\",base_url=~\"$base_url\",collection=~\"$collection\",shard=~\"$shard\",replica=~\"$replica\",core=~\"$core\",searchHandler=~\"$searchHandler\"}",
+ "expr": "solr_metrics_core_query_p95_ms{internal!=\"false\",base_url=~\"$base_url\",collection=~\"$collection\",shard=~\"$shard\",replica=~\"$replica\",core=~\"$core\",searchHandler=~\"$searchHandler\"}",
"format": "time_series",
"interval": "",
"intervalFactor": 3,
diff --git a/solr/prometheus-exporter/conf/solr-exporter-config.xml b/solr/prometheus-exporter/conf/solr-exporter-config.xml
index 8e03b9fbbb4..d13a6f451be 100644
--- a/solr/prometheus-exporter/conf/solr-exporter-config.xml
+++ b/solr/prometheus-exporter/conf/solr-exporter-config.xml
@@ -567,6 +567,9 @@
<!--
Query related core metrics; see jq-templates for details on the core-query template used below
-->
+ <str>
+ $jq:core-query(requests_total, select(.key | endswith(".requestTimes")), count, COUNTER)
+ </str>
<str>
$jq:core-query(errors_1minRate, select(.key | endswith(".errors")), 1minRate)
</str>