| <?xml version="1.0" encoding="UTF-8" ?> |
| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <config> |
| |
| <rules> |
| |
| <ping> |
| <lst name="request"> |
| <lst name="query"> |
| <str name="path">/admin/ping</str> |
| <str name="wt">json</str> |
| </lst> |
| <arr name="jsonQueries"> |
| <str> |
| . as $object | $object | |
| (if $object.status == "OK" then 1.0 else 0.0 end) as $value | |
| { |
| name : "solr_ping", |
| type : "GAUGE", |
| help : "See following URL: https://lucene.apache.org/solr/guide/ping.html", |
| label_names : [], |
| label_values : [], |
| value : $value |
| } |
| </str> |
| </arr> |
| </lst> |
| </ping> |
| |
| <collections> |
| <lst name="request"> |
| <lst name="query"> |
| <str name="path">/admin/collections</str> |
| <lst name="params"> |
| <str name="action">CLUSTERSTATUS</str> |
| </lst> |
| </lst> |
| <arr name="jsonQueries"> |
| <str> |
| .cluster.live_nodes | length as $value| |
| { |
| name : "solr_collections_live_nodes", |
| type : "GAUGE", |
| help : "See following URL: https://lucene.apache.org/solr/guide/collections-api.html#clusterstatus", |
| label_names : [], |
| label_values : [], |
| value : $value |
| } |
| </str> |
| <str> |
| .cluster.collections | to_entries | .[] | . as $object | |
| $object.key as $collection | |
| $object.value.shards | to_entries | .[] | . as $shard_obj | |
| $shard_obj.key as $shard | |
| $shard_obj.value.replicas | to_entries | .[] | . as $replica_obj | |
| $replica_obj.key as $replica_name | |
| $replica_obj.value.core as $core | |
| $core[$collection + "_" + $shard + "_" | length:] as $replica | |
| $replica_obj.value.base_url as $base_url | |
| $replica_obj.value.node_name as $node_name | |
| $replica_obj.value.type as $type | |
| (if $replica_obj.value.leader == "true" then 1.0 else 0.0 end) as $value | |
| { |
| name : "solr_collections_shard_leader", |
| type : "GAUGE", |
| help : "See following URL: https://lucene.apache.org/solr/guide/collections-api.html#clusterstatus", |
| label_names : ["collection", "shard", "replica", "core", "type"], |
| label_values : [$collection, $shard, $replica, $core, $type], |
| value : $value |
| } |
| </str> |
| </arr> |
| </lst> |
| </collections> |
| |
| <metrics> |
| <lst name="request"> |
| <lst name="query"> |
| <str name="path">/admin/metrics</str> |
| <lst name="params"> |
| <str name="expr">solr\.jetty:.*DefaultHandler.*</str> |
| <str name="expr">solr\.jvm:.*</str> |
| <str name="expr">solr\.node:.*</str> |
| <str name="expr">solr\.overseer:.*</str> |
| <str name="expr">solr\.core\..*:QUERY\..*</str> |
| <str name="expr">solr\.core\..*:ADMIN\..*</str> |
| <str name="expr">solr\.core\..*:CACHE\..*</str> |
| <str name="expr">solr\.core\..*:UPDATE\.updateHandler\..*</str> |
| <str name="expr">solr\.core\..*:CORE\.fs\..*</str> |
| <str name="expr">solr\.core\..*:HIGHLIGHTER\..*</str> |
| <str name="expr">solr\.core\..*:INDEX\..*</str> |
| <str name="expr">solr\.core\..*:REPLICATION\.replication\..*</str> |
| <str name="expr">solr\.core\..*:SEARCHER\.searcher\..*</str> |
| </lst> |
| </lst> |
| <arr name="jsonQueries"> |
| <!-- |
| jvm metrics |
| --> |
| <str> |
| .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("buffers.")) | select(.key | |
| endswith(".Count")) as $object | |
| $object.key | split(".")[1] as $pool | |
| $object.value as $value | |
| { |
| name : "solr_metrics_jvm_buffers", |
| type : "GAUGE", |
| help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html", |
| label_names : ["pool"], |
| label_values : [$pool], |
| value : $value |
| } |
| </str> |
| </arr> |
| </lst> |
| </metrics> |
| |
| <search> |
| <lst name="request"> |
| <lst name="query"> |
| <str name="collection">collection1</str> |
| <str name="path">/select</str> |
| <lst name="params"> |
| <str name="q">*:*</str> |
| <str name="start">0</str> |
| <str name="rows">0</str> |
| <str name="json.facet"> |
| { |
| category: { |
| type: terms, |
| field: cat |
| } |
| } |
| </str> |
| </lst> |
| </lst> |
| <arr name="jsonQueries"> |
| <str> |
| .facets.category.buckets[] as $object | |
| $object.val as $term | |
| $object.count as $value | |
| { |
| name : "solr_facets_category", |
| type : "GAUGE", |
| help : "Category facets", |
| label_names : ["term"], |
| label_values : [$term], |
| value : $value |
| } |
| </str> |
| </arr> |
| </lst> |
| </search> |
| |
| </rules> |
| |
| </config> |