ite = result.get("label_values").iterator();ite.hasNext();){
+ JsonNode item = ite.next();
+ labelValues.add(item.textValue());
+ }
+
+ if (labelNames.indexOf("core") < 0 && labelNames.indexOf("collection") >= 0 && labelNames.indexOf("shard") >= 0 && labelNames.indexOf("replica") >= 0) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(labelValues.get(labelNames.indexOf("collection")))
+ .append("_")
+ .append(labelValues.get(labelNames.indexOf("shard")))
+ .append("_")
+ .append(labelValues.get(labelNames.indexOf("replica")));
+
+ labelNames.add("core");
+ labelValues.add(sb.toString());
+ }
+
+ if (!metricFamilySamplesMap.containsKey(name)) {
+ Collector.MetricFamilySamples metricFamilySamples = new Collector.MetricFamilySamples(
+ name,
+ Collector.Type.valueOf(type),
+ help,
+ new ArrayList<>()
+ );
+ metricFamilySamplesMap.put(name, metricFamilySamples);
+ }
+
+ Collector.MetricFamilySamples.Sample sample = new Collector.MetricFamilySamples.Sample(name, labelNames, labelValues, value);
+
+ if (!metricFamilySamplesMap.get(name).samples.contains(sample)) {
+ metricFamilySamplesMap.get(name).samples.add(sample);
+ }
+ }
+ } catch (JsonQueryException e) {
+ this.logger.error(e.toString() + " " + q.toString());
+ SolrExporter.scrapeErrorTotal.inc();
+ }
+ }
+ } catch (HttpSolrClient.RemoteSolrException | IOException e) {
+ this.logger.error("failed to request: " + e.toString());
+ } catch (Exception e) {
+ this.logger.error(e.toString());
+ e.printStackTrace();
+ }
+
+ return metricFamilySamplesMap;
+ }
+}
diff --git a/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/package-info.java b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/package-info.java
new file mode 100644
index 00000000000..85c4eaaaaa4
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/java/org/apache/solr/prometheus/scraper/package-info.java
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+/**
+ * Solr metrics scraper.
+ */
+package org.apache.solr.prometheus.scraper;
diff --git a/solr/contrib/prometheus-exporter/src/java/overview.html b/solr/contrib/prometheus-exporter/src/java/overview.html
new file mode 100644
index 00000000000..df1c45a6390
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/java/overview.html
@@ -0,0 +1,26 @@
+
+
+
+Apache Solr Search Server: Solr Prometheus Exporter contrib
+
+
+This package provides tools for monitoring Solr with Prometheus.
+
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/conf/log4j.properties b/solr/contrib/prometheus-exporter/src/test-files/conf/log4j.properties
new file mode 100644
index 00000000000..5dd689960d6
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/conf/log4j.properties
@@ -0,0 +1,22 @@
+#
+# 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.
+#
+
+log4j.rootLogger=INFO, stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSS} %-5p [%c] - %m%n
diff --git a/solr/contrib/prometheus-exporter/src/test-files/conf/solr-exporter-config.xml b/solr/contrib/prometheus-exporter/src/test-files/conf/solr-exporter-config.xml
new file mode 100644
index 00000000000..dc49f56f4f6
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/conf/solr-exporter-config.xml
@@ -0,0 +1,1806 @@
+
+
+
+
+
+
+
+
+
+
+ /admin/ping
+
+
+
+ . 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
+ }
+
+
+
+
+
+
+
+
+ /admin/metrics
+
+ all
+ all
+
+
+
+
+
+
+
+
+
+ .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
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("buffers.")) | select(.key | (endswith(".MemoryUsed") or endswith(".TotalCapacity"))) as $object |
+ $object.key | split(".")[1] as $pool |
+ $object.key | split(".") | last as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_buffers_bytes",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["pool", "item"],
+ label_values : [$pool, $item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("gc.")) | select(.key | endswith(".count")) as $object |
+ $object.key | split(".")[1] as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_gc_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : [$item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("gc.")) | select(.key | endswith(".time")) as $object |
+ $object.key | split(".")[1] as $item |
+ ($object.value / 1000) as $value |
+ {
+ name : "solr_metrics_jvm_gc_seconds_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : [$item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.heap.")) | select(.key | endswith(".usage") | not) as $object |
+ $object.key | split(".") | last as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_memory_heap_bytes",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : [$item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.non-heap.")) | select(.key | endswith(".usage") | not) as $object |
+ $object.key | split(".") | last as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_memory_non_heap_bytes",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : [$item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.pools.")) | select(.key | endswith(".usage") | not) as $object |
+ $object.key | split(".")[2] as $space |
+ $object.key | split(".") | last as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_memory_pools_bytes",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["space", "item"],
+ label_values : [$space, $item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("memory.total.")) as $object |
+ $object.key | split(".") | last as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_memory_bytes",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : [$item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.committedVirtualMemorySize" or .key == "os.freePhysicalMemorySize" or .key == "os.freeSwapSpaceSize" or .key =="os.totalPhysicalMemorySize" or .key == "os.totalSwapSpaceSize") as $object |
+ $object.key | split(".") | last as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_os_memory_bytes",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : [$item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.maxFileDescriptorCount" or .key == "os.openFileDescriptorCount") as $object |
+ $object.key | split(".") | last as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_os_file_descriptors",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : [$item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.processCpuLoad" or .key == "os.systemCpuLoad") as $object |
+ $object.key | split(".") | last as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_os_cpu_load",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : [$item],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.processCpuTime") as $object |
+ ($object.value / 1000.0) as $value |
+ {
+ name : "solr_metrics_jvm_os_cpu_time_seconds",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : ["processCpuTime"],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key == "os.systemLoadAverage") as $object |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_os_load_average",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : ["systemLoadAverage"],
+ value : $value
+ }
+
+
+ .metrics["solr.jvm"] | to_entries | .[] | select(.key | startswith("threads.")) | select(.key | endswith(".count")) as $object |
+ $object.key | split(".")[1] as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_jvm_threads",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["item"],
+ label_values : [$item],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".clientErrors")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ {
+ name : "solr_metrics_node_client_errors_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler"],
+ label_values : [$category, $handler],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".clientErrors")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ {
+ name : "solr_metrics_node_errors_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler"],
+ label_values : [$category, $handler],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".requestTimes")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ {
+ name : "solr_metrics_node_requests_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler"],
+ label_values : [$category, $handler],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".serverErrors")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ {
+ name : "solr_metrics_node_server_errors_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler"],
+ label_values : [$category, $handler],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".timeouts")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ {
+ name : "solr_metrics_node_timeouts_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler"],
+ label_values : [$category, $handler],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | endswith(".totalTime")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ ($object.value / 1000) as $value |
+ {
+ name : "solr_metrics_node_time_seconds_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler"],
+ label_values : [$category, $handler],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | startswith("CONTAINER.cores.")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[2] as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_node_cores",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "item"],
+ label_values : [$category, $item],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | startswith("CONTAINER.fs.coreRoot.")) | select(.key | endswith(".totalSpace") or endswith(".usableSpace")) as $object |
+ $object.key | split(".") as $key_items |
+ $key_items | length as $label_len |
+ $key_items[0] as $category |
+ $key_items[3] as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_node_core_root_fs_bytes",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "item"],
+ label_values : [$category, $item],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | contains(".threadPool.")) | select(.key | endswith(".completed")) as $object |
+ $object.key | split(".") as $key_items |
+ $key_items | length as $label_len |
+ $key_items[0] as $category |
+ (if $label_len >= 5 then $key_items[1] else "" end) as $handler |
+ (if $label_len >= 5 then $key_items[3] else $key_items[2] end) as $executor |
+ $object.value.count as $value |
+ {
+ name : "solr_metrics_node_thread_pool_completed_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler", "executor"],
+ label_values : [$category, $handler, $executor],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | contains(".threadPool.")) | select(.key | endswith(".running")) as $object |
+ $object.key | split(".") as $key_items |
+ $key_items | length as $label_len |
+ $key_items[0] as $category |
+ (if $label_len >= 5 then $key_items[1] else "" end) as $handler |
+ (if $label_len >= 5 then $key_items[3] else $key_items[2] end) as $executor |
+ $object.value as $value |
+ {
+ name : "solr_metrics_node_thread_pool_running",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler", "executor"],
+ label_values : [$category, $handler, $executor],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | contains(".threadPool.")) | select(.key | endswith(".submitted")) as $object |
+ $object.key | split(".") as $key_items |
+ $key_items | length as $label_len |
+ $key_items[0] as $category |
+ (if $label_len >= 5 then $key_items[1] else "" end) as $handler |
+ (if $label_len >= 5 then $key_items[3] else $key_items[2] end) as $executor |
+ $object.value.count as $value |
+ {
+ name : "solr_metrics_node_thread_pool_submitted_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler", "executor"],
+ label_values : [$category, $handler, $executor],
+ value : $value
+ }
+
+
+ .metrics["solr.node"] | to_entries | .[] | select(.key | endswith("Connections")) as $object |
+ $object.key | split(".") as $key_items |
+ $key_items | length as $label_len |
+ $key_items[0] as $category |
+ $key_items[1] as $handler |
+ $key_items[2] as $item |
+ $object.value as $value |
+ {
+ name : "solr_metrics_node_connections",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["category", "handler", "item"],
+ label_values : [$category, $handler, $item],
+ value : $value
+ }
+
+
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | endswith(".clientErrors")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ select($handler | startswith("/")) |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_client_errors_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_client_errors_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | endswith(".errors")) | select (.value | type == "object") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ select($handler | startswith("/")) |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_errors_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_errors_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | endswith(".requestTimes")) | select (.value | type == "object") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ select($handler | startswith("/")) |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_requests_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_requests_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | endswith(".serverErrors")) | select (.value | type == "object") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ select($handler | startswith("/")) |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_server_errors_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_server_errors_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | endswith(".timeouts")) | select (.value | type == "object") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ select($handler | startswith("/")) |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_timeouts_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_timeouts_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | endswith(".totalTime")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ select($handler | startswith("/")) |
+ ($object.value / 1000) as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_time_seconds_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_time_seconds_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select (.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "CACHE.core.fieldCache") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.value.entries_count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_field_cache_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core"],
+ label_values: [$category, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_field_cache_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica"],
+ label_values: [$category, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[2] as $type |
+ $object.value | to_entries | .[] | select(.key == "lookups" or .key == "hits" or .key == "size" or .key == "evictions" or .key == "inserts") as $target |
+ $target.key as $item |
+ $target.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_searcher_cache",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "type", "item"],
+ label_values: [$category, $core, $type, $item],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_searcher_cache",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+ label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[2] as $type |
+ $object.value | to_entries | .[] | select(.key == "hitratio") as $target |
+ $target.key as $item |
+ $target.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_searcher_cache_ratio",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "type", "item"],
+ label_values: [$category, $core, $type, $item],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_searcher_cache_ratio",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+ label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[2] as $type |
+ $object.value | to_entries | .[] | select(.key == "warmupTime") as $target |
+ $target.key as $item |
+ ($target.value / 1000) as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_searcher_warmup_time_seconds",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "type", "item"],
+ label_values: [$category, $core, $type, $item],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_searcher_warmup_time_seconds",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+ label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[2] as $type |
+ $object.value | to_entries | .[] | select(.key == "cumulative_lookups" or .key == "cumulative_hits" or .key == "cumulative_evictions" or .key == "cumulative_inserts") as $target |
+ $target.key as $item |
+ $target.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_searcher_cumulative_cache_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "type", "item"],
+ label_values: [$category, $core, $type, $item],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_searcher_cumulative_cache_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+ label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | startswith("CACHE.searcher.")) | select (.key | endswith("documentCache") or endswith("fieldValueCache") or endswith("filterCache") or endswith("perSegFilter") or endswith("queryResultCache")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[2] as $type |
+ $object.value | to_entries | .[] | select(.key == "cumulative_hitratio") as $target |
+ $target.key as $item |
+ $target.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_searcher_cumulative_cache_ratio",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "type", "item"],
+ label_values: [$category, $core, $type, $item],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_searcher_cumulative_cache_ratio",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica", "type", "item"],
+ label_values: [$category, $core, $collection, $shard, $replica, $type, $item],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | startswith("CORE.fs.")) | select (.key | endswith(".totalSpace") or endswith(".usableSpace")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[2] as $item |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_fs_bytes",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "item"],
+ label_values: [$category, $core, $item],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_fs_bytes",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica", "item"],
+ label_values: [$category, $core, $collection, $shard, $replica, $item],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key | startswith("HIGHLIGHTER.")) | select (.key | endswith(".requests")) as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $name |
+ $object.key | split(".")[2] as $item |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_highlighter_request_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "name", "item"],
+ label_values: [$category, $core, $name, $item],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_highlighter_request_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica", "name", "item"],
+ label_values: [$category, $core, $collection, $shard, $replica, $name, $item],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "INDEX.sizeInBytes") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_index_size_bytes",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core"],
+ label_values: [$category, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_index_size_bytes",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica"],
+ label_values: [$category, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "REPLICATION./replication.isMaster") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ (if $object.value == true then 1.0 else 0.0 end) as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_replication_master",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_replication_master",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "REPLICATION./replication.isSlave") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ (if $object.value == true then 1.0 else 0.0 end) as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_replication_slave",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_replication_slave",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "SEARCHER.searcher.deletedDocs" or .key == "SEARCHER.searcher.maxDoc" or .key == "SEARCHER.searcher.numDocs") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[2] as $item |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_searcher_documents",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "item"],
+ label_values: [$category, $core, $item],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_searcher_documents",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "core", "collection", "shard", "replica", "item"],
+ label_values: [$category, $core, $collection, $shard, $replica, $item],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.adds") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_adds",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_adds",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.autoCommits") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_auto_commits_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_auto_commits_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.commits") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_commits_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_commits_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeAdds") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_adds_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_adds_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeDeletesById") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_deletes_by_id_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_deletes_by_id_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeDeletesByQuery") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_deletes_by_query_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_deletes_by_query_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.cumulativeErrors") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_errors_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_errors_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.deletesById") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_deletes_by_id",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_deletes_by_id",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.deletesByQuery") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_deletes_by_query",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_deletes_by_query",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.docsPending") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_pending_docs",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_pending_docs",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.errors") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_errors",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_errors",
+ type: "GAUGE",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.expungeDeletes") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_expunge_deletes_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_expunge_deletes_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.merges") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_merges_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_merges_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.optimizes") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_optimizes_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_optimizes_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.rollbacks") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_rollbacks_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_rollbacks_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.softAutoCommits") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_soft_auto_commits_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_soft_auto_commits_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+ .metrics | to_entries | .[] | select(.key | startswith("solr.core.")) as $parent |
+ $parent.key | split(".") as $parent_key_items |
+ $parent_key_items | length as $parent_key_item_len |
+ (if $parent_key_item_len == 3 then $parent_key_items[2] else "" end) as $core |
+ (if $parent_key_item_len == 5 then $parent_key_items[2] else "" end) as $collection |
+ (if $parent_key_item_len == 5 then $parent_key_items[3] else "" end) as $shard |
+ (if $parent_key_item_len == 5 then $parent_key_items[4] else "" end) as $replica |
+ (if $parent_key_item_len == 5 then ($collection + "_" + $shard + "_" + $replica) else $core end) as $core |
+ $parent.value | to_entries | .[] | select(.key == "UPDATE.updateHandler.splits") as $object |
+ $object.key | split(".")[0] as $category |
+ $object.key | split(".")[1] as $handler |
+ $object.value.count as $value |
+ if $parent_key_item_len == 3 then
+ {
+ name: "solr_metrics_core_update_handler_splits_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core"],
+ label_values: [$category, $handler, $core],
+ value: $value
+ }
+ else
+ {
+ name: "solr_metrics_core_update_handler_splits_total",
+ type: "COUNTER",
+ help: "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names: ["category", "handler", "core", "collection", "shard", "replica"],
+ label_values: [$category, $handler, $core, $collection, $shard, $replica],
+ value: $value
+ }
+ end
+
+
+
+
+
+
+
+
+ /admin/collections
+
+ CLUSTERSTATUS
+
+
+
+
+ .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
+ }
+
+
+ .cluster.collections | to_entries | .[] | . as $object |
+ $object.key as $collection |
+ $object.value.pullReplicas | tonumber as $value |
+ {
+ name : "solr_collections_pull_replicas",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/collections-api.html#clusterstatus",
+ label_names : ["collection"],
+ label_values : [$collection],
+ value : $value
+ }
+
+
+ .cluster.collections | to_entries | .[] | . as $object |
+ $object.key as $collection |
+ $object.value.nrtReplicas | tonumber as $value |
+ {
+ name : "solr_collections_nrt_replicas",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/collections-api.html#clusterstatus",
+ label_names : ["collection"],
+ label_values : [$collection],
+ value : $value
+ }
+
+
+ .cluster.collections | to_entries | .[] | . as $object |
+ $object.key as $collection |
+ $object.value.tlogReplicas | tonumber as $value |
+ {
+ name : "solr_collections_tlog_replicas",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/collections-api.html#clusterstatus",
+ label_names : ["collection"],
+ label_values : [$collection],
+ value : $value
+ }
+
+
+ .cluster.collections | to_entries | .[] | . as $object |
+ $object.key as $collection |
+ $object.value.shards | to_entries | .[] | . as $shard_obj |
+ $shard_obj.key as $shard |
+ (if $shard_obj.value.state == "active" then 1.0 else 0.0 end) as $value |
+ {
+ name : "solr_collections_shard_state",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/collections-api.html#clusterstatus",
+ label_names : ["collection","shard"],
+ label_values : [$collection,$shard],
+ value : $value
+ }
+
+
+ .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.state == "active" then 1.0 else 0.0 end) as $value |
+ {
+ name : "solr_collections_replica_state",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/collections-api.html#clusterstatus",
+ label_names : ["collection", "shard", "replica", "replica_name", "core", "base_url", "node_name", "type"],
+ label_values : [$collection, $shard, $replica, $replica_name, $core, $base_url, $node_name, $type],
+ value : $value
+ }
+
+
+ .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", "replica_name", "core", "base_url", "node_name", "type"],
+ label_values : [$collection, $shard, $replica, $replica_name, $core, $base_url, $node_name, $type],
+ value : $value
+ }
+
+
+
+
+
+
+
+
+ collection1
+ /select
+
+ *:*
+ 0
+ 0
+
+ {
+ category: {
+ type: terms,
+ field: cat
+ }
+ }
+
+
+
+
+
+ .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
+ }
+
+
+
+
+
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema
new file mode 100644
index 00000000000..caa3317e632
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/managed-schema
@@ -0,0 +1,412 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ id
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml
new file mode 100644
index 00000000000..72c54304f24
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/solrconfig.xml
@@ -0,0 +1,232 @@
+
+
+
+
+
+ ${tests.luceneMatchVersion:LATEST}
+
+ ${solr.data.dir:}
+
+
+
+
+
+
+ ${solr.lock.type:native}
+
+
+
+
+
+
+
+ ${solr.ulog.dir:}
+ ${solr.ulog.numVersionBuckets:65536}
+
+
+
+ ${solr.autoCommit.maxTime:15000}
+ false
+
+
+
+ ${solr.autoSoftCommit.maxTime:-1}
+
+
+
+
+
+
+ 1024
+
+
+
+
+
+
+
+
+
+ true
+
+ 20
+
+ 200
+
+
+
+
+
+
+
+
+
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+ explicit
+ 10
+
+
+
+
+
+
+
+
+
+ [^\w-\.]
+ _
+
+
+
+
+
+
+ yyyy-MM-dd'T'HH:mm:ss.SSSZ
+ yyyy-MM-dd'T'HH:mm:ss,SSSZ
+ yyyy-MM-dd'T'HH:mm:ss.SSS
+ yyyy-MM-dd'T'HH:mm:ss,SSS
+ yyyy-MM-dd'T'HH:mm:ssZ
+ yyyy-MM-dd'T'HH:mm:ss
+ yyyy-MM-dd'T'HH:mmZ
+ yyyy-MM-dd'T'HH:mm
+ yyyy-MM-dd HH:mm:ss.SSSZ
+ yyyy-MM-dd HH:mm:ss,SSSZ
+ yyyy-MM-dd HH:mm:ss.SSS
+ yyyy-MM-dd HH:mm:ss,SSS
+ yyyy-MM-dd HH:mm:ssZ
+ yyyy-MM-dd HH:mm:ss
+ yyyy-MM-dd HH:mmZ
+ yyyy-MM-dd HH:mm
+ yyyy-MM-dd
+
+
+
+
+ java.lang.String
+ text_general
+
+ *_str
+ 256
+
+
+ true
+
+
+ java.lang.Boolean
+ booleans
+
+
+ java.util.Date
+ pdates
+
+
+ java.lang.Long
+ java.lang.Integer
+ plongs
+
+
+ java.lang.Number
+ pdoubles
+
+
+
+
+
+
+
+
+
+
+
+
+ text/plain; charset=UTF-8
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt
new file mode 100644
index 00000000000..ae1e83eeb3d
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/stopwords.txt
@@ -0,0 +1,14 @@
+# 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.
diff --git a/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt
new file mode 100644
index 00000000000..eab4ee87537
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/configsets/collection1/conf/synonyms.txt
@@ -0,0 +1,29 @@
+# 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.
+
+#-----------------------------------------------------------------------
+#some test synonym mappings unlikely to appear in real input text
+aaafoo => aaabar
+bbbfoo => bbbfoo bbbbar
+cccfoo => cccbar cccbaz
+fooaaa,baraaa,bazaaa
+
+# Some synonym groups specific to this example
+GB,gib,gigabyte,gigabytes
+MB,mib,megabyte,megabytes
+Television, Televisions, TV, TVs
+#notice we use "gib" instead of "GiB" so any WordDelimiterGraphFilter coming
+#after us won't split it into two words.
+
+# Synonym mappings can be used for spelling correction too
+pixima => pixma
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml
new file mode 100644
index 00000000000..01743d3675c
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/gb18030-example.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+ GB18030TEST
+ Test with some GB18030 encoded characters
+ No accents here
+ ÕâÊÇÒ»¸ö¹¦ÄÜ
+ This is a feature (translated)
+ Õâ·ÝÎļþÊǺÜÓйâÔó
+ This document is very shiny (translated)
+ 0.0
+ true
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml
new file mode 100644
index 00000000000..9cf7d1b05d8
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/hd.xml
@@ -0,0 +1,56 @@
+
+
+
+
+ SP2514N
+ Samsung SpinPoint P120 SP2514N - hard drive - 250 GB - ATA-133
+ Samsung Electronics Co. Ltd.
+
+ samsung
+ electronics
+ hard drive
+ 7200RPM, 8MB cache, IDE Ultra ATA-133
+ NoiseGuard, SilentSeek technology, Fluid Dynamic Bearing (FDB) motor
+ 92.0
+ 6
+ true
+ 2006-02-13T15:26:37Z
+
+ 35.0752,-97.032
+
+
+
+ 6H500F0
+ Maxtor DiamondMax 11 - hard drive - 500 GB - SATA-300
+ Maxtor Corp.
+
+ maxtor
+ electronics
+ hard drive
+ SATA 3.0Gb/s, NCQ
+ 8.5ms seek
+ 16MB cache
+ 350.0
+ 6
+ true
+
+ 45.17614,-93.87341
+ 2006-02-13T15:26:37Z
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml
new file mode 100644
index 00000000000..3de32f3b71c
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_other.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+ F8V7067-APL-KIT
+ Belkin Mobile Power Cord for iPod w/ Dock
+ Belkin
+
+ belkin
+ electronics
+ connector
+ car power adapter, white
+ 4.0
+ 19.95
+ 1
+ false
+
+ 45.18014,-93.87741
+ 2005-08-01T16:30:25Z
+
+
+
+ IW-02
+ iPod & iPod Mini USB 2.0 Cable
+ Belkin
+
+ belkin
+ electronics
+ connector
+ car power adapter for iPod, white
+ 2.0
+ 11.50
+ 1
+ false
+
+ 37.7752,-122.4232
+ 2006-02-14T23:55:59Z
+
+
+
+
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml
new file mode 100644
index 00000000000..1ca5f6f5c21
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/ipod_video.xml
@@ -0,0 +1,40 @@
+
+
+
+ MA147LL/A
+ Apple 60 GB iPod with Video Playback Black
+ Apple Computer Inc.
+
+ apple
+ electronics
+ music
+ iTunes, Podcasts, Audiobooks
+ Stores up to 15,000 songs, 25,000 photos, or 150 hours of video
+ 2.5-inch, 320x240 color TFT LCD display with LED backlight
+ Up to 20 hours of battery life
+ Plays AAC, MP3, WAV, AIFF, Audible, Apple Lossless, H.264 video
+ Notes, Calendar, Phone book, Hold button, Date display, Photo wallet, Built-in games, JPEG photo playback, Upgradeable firmware, USB 2.0 compatibility, Playback speed control, Rechargeable capability, Battery level indication
+ earbud headphones, USB cable
+ 5.5
+ 399.00
+ 10
+ true
+
+ 37.7752,-100.0232
+ 2005-10-12T08:00:00Z
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml
new file mode 100644
index 00000000000..e3121d5db1f
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/manufacturers.xml
@@ -0,0 +1,75 @@
+
+
+
+
+ adata
+ A-Data Technology
+ 46221 Landing Parkway Fremont, CA 94538
+
+
+ apple
+ Apple
+ 1 Infinite Way, Cupertino CA
+
+
+ asus
+ ASUS Computer
+ 800 Corporate Way Fremont, CA 94539
+
+
+ ati
+ ATI Technologies
+ 33 Commerce Valley Drive East Thornhill, ON L3T 7N6 Canada
+
+
+ belkin
+ Belkin
+ 12045 E. Waterfront Drive Playa Vista, CA 90094
+
+
+ canon
+ Canon, Inc.
+ One Canon Plaza Lake Success, NY 11042
+
+
+ corsair
+ Corsair Microsystems
+ 46221 Landing Parkway Fremont, CA 94538
+
+
+ dell
+ Dell, Inc.
+ One Dell Way Round Rock, Texas 78682
+
+
+ maxtor
+ Maxtor Corporation
+ 920 Disc Drive Scotts Valley, CA 95066
+
+
+ samsung
+ Samsung Electronics Co. Ltd.
+ 105 Challenger Rd. Ridgefield Park, NJ 07660-0511
+
+
+ viewsonic
+ ViewSonic Corp
+ 381 Brea Canyon Road Walnut, CA 91789-0708
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml
new file mode 100644
index 00000000000..48af5222fe4
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mem.xml
@@ -0,0 +1,77 @@
+
+
+
+
+ TWINX2048-3200PRO
+ CORSAIR XMS 2GB (2 x 1GB) 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) Dual Channel Kit System Memory - Retail
+ Corsair Microsystems Inc.
+
+ corsair
+ electronics
+ memory
+ CAS latency 2, 2-3-3-6 timing, 2.75v, unbuffered, heat-spreader
+ 185.00
+ 5
+ true
+
+ 37.7752,-122.4232
+ 2006-02-13T15:26:37Z
+
+
+ electronics|6.0 memory|3.0
+
+
+
+ VS1GB400C3
+ CORSAIR ValueSelect 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - Retail
+ Corsair Microsystems Inc.
+
+ corsair
+ electronics
+ memory
+ 74.99
+ 7
+ true
+
+ 37.7752,-100.0232
+ 2006-02-13T15:26:37Z
+
+ electronics|4.0 memory|2.0
+
+
+
+ VDBDB1A16
+ A-DATA V-Series 1GB 184-Pin DDR SDRAM Unbuffered DDR 400 (PC 3200) System Memory - OEM
+ A-DATA Technology Inc.
+
+ corsair
+ electronics
+ memory
+ CAS latency 3, 2.7v
+
+ 0
+ true
+
+ 45.18414,-93.88141
+ 2006-02-13T15:26:37Z
+
+ electronics|0.9 memory|0.1
+
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml
new file mode 100644
index 00000000000..b1b8036c369
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/money.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+ USD
+ One Dollar
+ Bank of America
+ boa
+ currency
+ Coins and notes
+ 1,USD
+ true
+
+
+
+ EUR
+ One Euro
+ European Union
+ eu
+ currency
+ Coins and notes
+ 1,EUR
+ true
+
+
+
+ GBP
+ One British Pound
+ U.K.
+ uk
+ currency
+ Coins and notes
+ 1,GBP
+ true
+
+
+
+ NOK
+ One Krone
+ Bank of Norway
+ nor
+ currency
+ Coins and notes
+ 1,NOK
+ true
+
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml
new file mode 100644
index 00000000000..d0343af1594
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor.xml
@@ -0,0 +1,34 @@
+
+
+
+ 3007WFP
+ Dell Widescreen UltraSharp 3007WFP
+ Dell, Inc.
+
+ dell
+ electronics and computer1
+ 30" TFT active matrix LCD, 2560 x 1600, .25mm dot pitch, 700:1 contrast
+ USB cable
+ 401.6
+ 2199.0
+ 6
+ true
+
+ 43.17614,-90.57341
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml
new file mode 100644
index 00000000000..eaf9e223ccd
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/monitor2.xml
@@ -0,0 +1,33 @@
+
+
+
+ VA902B
+ ViewSonic VA902B - flat panel display - TFT - 19"
+ ViewSonic Corp.
+
+ viewsonic
+ electronics and stuff2
+ 19" TFT active matrix LCD, 8ms response time, 1280 x 1024 native resolution
+ 190.4
+ 279.95
+ 6
+ true
+
+ 45.18814,-93.88541
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml
new file mode 100644
index 00000000000..a8f51b643ca
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/mp500.xml
@@ -0,0 +1,43 @@
+
+
+
+ 0579B002
+ Canon PIXMA MP500 All-In-One Photo Printer
+ Canon Inc.
+
+ canon
+ electronics
+ multifunction printer
+ printer
+ scanner
+ copier
+ Multifunction ink-jet color photo printer
+ Flatbed scanner, optical scan resolution of 1,200 x 2,400 dpi
+ 2.5" color LCD preview screen
+ Duplex Copying
+ Printing speed up to 29ppm black, 19ppm color
+ Hi-Speed USB
+ memory card: CompactFlash, Micro Drive, SmartMedia, Memory Stick, Memory Stick Pro, SD Card, and MultiMediaCard
+ 352.0
+ 179.99
+ 6
+ true
+
+ 45.19214,-93.89941
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html
new file mode 100644
index 00000000000..656b656b6ab
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sample.html
@@ -0,0 +1,13 @@
+
+
+ Welcome to Solr
+
+
+
+ Here is some text
+
+distinct
words
+Here is some text in a div
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml
new file mode 100644
index 00000000000..145c6fd5de6
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/sd500.xml
@@ -0,0 +1,38 @@
+
+
+
+ 9885A004
+ Canon PowerShot SD500
+ Canon Inc.
+
+ canon
+ electronics
+ camera
+ 3x zoop, 7.1 megapixel Digital ELPH
+ movie clips up to 640x480 @30 fps
+ 2.0" TFT LCD, 118,000 pixels
+ built in flash, red-eye reduction
+ 32MB SD card, USB cable, AV cable, battery
+ 6.4
+ 329.95
+ 7
+ true
+ 2006-02-13T15:26:37Z
+
+ 45.19614,-93.90341
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml
new file mode 100644
index 00000000000..a3656175217
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/solr.xml
@@ -0,0 +1,38 @@
+
+
+
+
+ SOLR1000
+ Solr, the Enterprise Search Server
+ Apache Software Foundation
+ software
+ search
+ Advanced Full-Text Search Capabilities using Lucene
+ Optimized for High Volume Web Traffic
+ Standards Based Open Interfaces - XML and HTTP
+ Comprehensive HTML Administration Interfaces
+ Scalability - Efficient Replication to other Solr Search Servers
+ Flexible and Adaptable with XML configuration and Schema
+ Good unicode support: héllo (hello with an accent over the e)
+ 0.0
+ 10
+ true
+ 2006-01-17T00:00:00.000Z
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml
new file mode 100644
index 00000000000..ee300a68306
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/utf8-example.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+ UTF8TEST
+ Test with some UTF-8 encoded characters
+ Apache Software Foundation
+ software
+ search
+ No accents here
+ This is an e acute: é
+ eaiou with circumflexes: êâîôû
+ eaiou with umlauts: ëäïöü
+ tag with escaped chars: <nicetag/>
+ escaped ampersand: Bonnie & Clyde
+ Outside the BMP:ðŒˆ codepoint=10308, a circle with an x inside. UTF8=f0908c88 UTF16=d800 df08
+ 0.0
+ true
+
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml
new file mode 100644
index 00000000000..d867d82acd1
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test-files/exampledocs/vidcard.xml
@@ -0,0 +1,62 @@
+
+
+
+
+ EN7800GTX/2DHTV/256M
+ ASUS Extreme N7800GTX/2DHTV (256 MB)
+
+ ASUS Computer Inc.
+
+ asus
+ electronics
+ graphics card
+ NVIDIA GeForce 7800 GTX GPU/VPU clocked at 486MHz
+ 256MB GDDR3 Memory clocked at 1.35GHz
+ PCI Express x16
+ Dual DVI connectors, HDTV out, video input
+ OpenGL 2.0, DirectX 9.0
+ 16.0
+ 479.95
+ 7
+ 40.7143,-74.006
+ false
+ 2006-02-13T15:26:37Z/DAY
+
+
+
+ 100-435805
+ ATI Radeon X1900 XTX 512 MB PCIE Video Card
+ ATI Technologies
+
+ ati
+ electronics
+ graphics card
+ ATI RADEON X1900 GPU/VPU clocked at 650MHz
+ 512MB GDDR3 SDRAM clocked at 1.55GHz
+ PCI Express x16
+ dual DVI, HDTV, svideo, composite out
+ OpenGL 2.0, DirectX 9.0
+ 48.0
+ 649.99
+ 7
+ false
+ 2006-02-13T15:26:37Z/DAY
+
+ 40.7143,-74.006
+
+
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java
new file mode 100644
index 00000000000..676f8abac9a
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/collector/SolrCollectorTest.java
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ */
+package org.apache.solr.prometheus.collector;
+
+import org.apache.solr.core.Config;
+import org.apache.solr.core.SolrResourceLoader;
+import org.apache.solr.prometheus.exporter.SolrExporter;
+import org.apache.solr.prometheus.exporter.SolrExporterTestBase;
+import io.prometheus.client.CollectorRegistry;
+import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
+import org.junit.Test;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Unit test for SolrCollector.
+ */
+@Slow
+public class SolrCollectorTest extends SolrExporterTestBase {
+ CollectorRegistry registry;
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ registry = new CollectorRegistry();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ @Test
+ public void testSolrCollector() throws Exception {
+ String name = "solr-exporter-config.xml";
+ SolrResourceLoader loader = new SolrResourceLoader(getFile("conf/").toPath());
+ Config config = new Config(loader, name);
+
+ CloudSolrClient cloudSolrClient = cluster.getSolrClient();
+
+ SolrCollector collector = new SolrCollector(cloudSolrClient, config, 1);
+
+ assertNotNull(collector);
+ }
+
+ @Test
+ public void testCollect() throws Exception {
+ String name = "solr-exporter-config.xml";
+ SolrResourceLoader loader = new SolrResourceLoader(getFile("conf/").toPath());
+ Config config = new Config(loader, name);
+
+ CloudSolrClient cloudSolrClient = cluster.getSolrClient();
+
+ SolrCollector collector = new SolrCollector(cloudSolrClient, config, 1);
+
+ this.registry.register(collector);
+ this.registry.register(SolrExporter.scrapeErrorTotal);
+
+ // index sample docs
+ File exampleDocsDir = new File(getFile("exampledocs").getAbsolutePath());
+ List xmlFiles = Arrays.asList(exampleDocsDir.listFiles((dir, file) -> file.endsWith(".xml")));
+ for (File xml : xmlFiles) {
+ ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update");
+ req.addFile(xml, "application/xml");
+ cloudSolrClient.request(req, "collection1");
+ }
+ cloudSolrClient.commit("collection1");
+
+ // collect metrics
+ collector.collect();
+
+ // check scrape error count
+ assertEquals(0.0, registry.getSampleValue("solr_exporter_scrape_error_total", new String[]{}, new String[]{}), .001);
+ }
+}
+
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java
new file mode 100644
index 00000000000..237a6cbef72
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTest.java
@@ -0,0 +1,99 @@
+/*
+ * 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.
+ */
+package org.apache.solr.prometheus.exporter;
+
+import org.apache.http.HttpStatus;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.lucene.util.LuceneTestCase.Slow;
+import org.apache.solr.client.solrj.impl.CloudSolrClient;
+import org.apache.solr.client.solrj.request.ContentStreamUpdateRequest;
+import org.junit.Test;
+
+import java.io.File;
+import java.net.ServerSocket;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * Unit test for SolrExporter.
+ */
+@Slow
+public class SolrExporterTest extends SolrExporterTestBase {
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ @Test
+ public void testExecute() throws Exception {
+ // solr client
+ CloudSolrClient cloudSolrClient = cluster.getSolrClient();
+
+ int port;
+ ServerSocket socket = null;
+ try {
+ socket = new ServerSocket(0);
+ port = socket.getLocalPort();
+ } finally {
+ socket.close();
+ }
+
+ // index sample docs
+ File exampleDocsDir = new File(getFile("exampledocs").getAbsolutePath());
+ List xmlFiles = Arrays.asList(exampleDocsDir.listFiles((dir, name) -> name.endsWith(".xml")));
+ for (File xml : xmlFiles) {
+ ContentStreamUpdateRequest req = new ContentStreamUpdateRequest("/update");
+ req.addFile(xml, "application/xml");
+ cloudSolrClient.request(req, "collection1");
+ }
+ cloudSolrClient.commit("collection1");
+
+ // start exporter
+ SolrExporter solrExporter = new SolrExporter(port, cloudSolrClient, getFile("conf/solr-exporter-config.xml").toPath(), 1);
+ try {
+ solrExporter.start();
+
+ URI uri = new URI("http://localhost:" + String.valueOf(port) + "/metrics");
+
+ CloseableHttpClient httpclient = HttpClients.createDefault();
+ CloseableHttpResponse response = null;
+ try {
+ HttpGet request = new HttpGet(uri);
+ response = httpclient.execute(request);
+
+ int expectedHTTPStatusCode = HttpStatus.SC_OK;
+ int actualHTTPStatusCode = response.getStatusLine().getStatusCode();
+ assertEquals(expectedHTTPStatusCode, actualHTTPStatusCode);
+ } finally {
+ response.close();
+ httpclient.close();
+ }
+ } finally {
+ solrExporter.stop();
+ }
+ }
+}
diff --git a/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java
new file mode 100644
index 00000000000..57ba8e03811
--- /dev/null
+++ b/solr/contrib/prometheus-exporter/src/test/org/apache/solr/prometheus/exporter/SolrExporterTestBase.java
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+package org.apache.solr.prometheus.exporter;
+
+import com.carrotsearch.randomizedtesting.annotations.ThreadLeakScope;
+import org.apache.solr.client.solrj.request.CollectionAdminRequest;
+import org.apache.solr.cloud.AbstractDistribZkTestBase;
+import org.apache.solr.cloud.SolrCloudTestCase;
+import org.junit.BeforeClass;
+
+/**
+ * Test base class.
+ */
+@ThreadLeakScope(ThreadLeakScope.Scope.NONE)
+public class SolrExporterTestBase extends SolrCloudTestCase {
+ public static String COLLECTION = "collection1";
+ public static String CONF_NAME = COLLECTION + "_config";
+ public static String CONF_DIR = getFile("configsets/" + COLLECTION + "/conf").getAbsolutePath();
+ public static int NUM_SHARDS = 2;
+ public static int NUM_REPLICAS = 2;
+ public static int MAX_SHARDS_PER_NODE = 1;
+ public static int NUM_NODES = (NUM_SHARDS * NUM_REPLICAS + (MAX_SHARDS_PER_NODE - 1)) / MAX_SHARDS_PER_NODE;
+ public static int TIMEOUT = 60;
+
+ @BeforeClass
+ public static void setupCluster() throws Exception {
+ configureCluster(NUM_NODES)
+ .addConfig(CONF_NAME, getFile(CONF_DIR).toPath())
+ .configure();
+
+ CollectionAdminRequest
+ .createCollection(COLLECTION, CONF_NAME, NUM_SHARDS, NUM_REPLICAS)
+ .setMaxShardsPerNode(MAX_SHARDS_PER_NODE)
+ .process(cluster.getSolrClient());
+
+ AbstractDistribZkTestBase
+ .waitForRecoveriesToFinish(COLLECTION, cluster.getSolrClient().getZkStateReader(), true, true, TIMEOUT);
+ }
+}
diff --git a/solr/licenses/argparse4j-0.8.1.jar.sha1 b/solr/licenses/argparse4j-0.8.1.jar.sha1
new file mode 100644
index 00000000000..27a0568b074
--- /dev/null
+++ b/solr/licenses/argparse4j-0.8.1.jar.sha1
@@ -0,0 +1 @@
+2c8241f84acf6c924bd75be0dbd68e8d74fbcd70
diff --git a/solr/licenses/argparse4j-LICENSE-MIT.txt b/solr/licenses/argparse4j-LICENSE-MIT.txt
new file mode 100644
index 00000000000..235421342ef
--- /dev/null
+++ b/solr/licenses/argparse4j-LICENSE-MIT.txt
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2011-2017 Tatsuhiro Tsujikawa
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use, copy,
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
\ No newline at end of file
diff --git a/solr/licenses/argparse4j-NOTICE.txt b/solr/licenses/argparse4j-NOTICE.txt
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/solr/licenses/jackson-jq-0.0.8.jar.sha1 b/solr/licenses/jackson-jq-0.0.8.jar.sha1
new file mode 100644
index 00000000000..4b7a4d297df
--- /dev/null
+++ b/solr/licenses/jackson-jq-0.0.8.jar.sha1
@@ -0,0 +1 @@
+9bd1a7f8268a436674a4f3210f11ef4eebe14d84
diff --git a/solr/licenses/jackson-jq-LICENSE-ASL.txt b/solr/licenses/jackson-jq-LICENSE-ASL.txt
new file mode 100644
index 00000000000..8fd4d51322d
--- /dev/null
+++ b/solr/licenses/jackson-jq-LICENSE-ASL.txt
@@ -0,0 +1,16 @@
+jackson-jq
+----------
+
+Copyright (C) 2015 Eiichi Sato
+
+Licensed 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.
\ No newline at end of file
diff --git a/solr/licenses/jackson-jq-NOTICE.txt b/solr/licenses/jackson-jq-NOTICE.txt
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/solr/licenses/simpleclient-0.2.0.jar.sha1 b/solr/licenses/simpleclient-0.2.0.jar.sha1
new file mode 100644
index 00000000000..ce8b16fb377
--- /dev/null
+++ b/solr/licenses/simpleclient-0.2.0.jar.sha1
@@ -0,0 +1 @@
+be8de6a5a01f25074be3b27a8db4448c9cce0168
diff --git a/solr/licenses/simpleclient-LICENSE-ASL.txt b/solr/licenses/simpleclient-LICENSE-ASL.txt
new file mode 100644
index 00000000000..261eeb9e9f8
--- /dev/null
+++ b/solr/licenses/simpleclient-LICENSE-ASL.txt
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
diff --git a/solr/licenses/simpleclient-NOTICE.txt b/solr/licenses/simpleclient-NOTICE.txt
new file mode 100644
index 00000000000..cbd3cd95bef
--- /dev/null
+++ b/solr/licenses/simpleclient-NOTICE.txt
@@ -0,0 +1,11 @@
+Prometheus instrumentation library for JVM applications
+Copyright 2012-2015 The Prometheus Authors
+
+This product includes software developed at
+Boxever Ltd. (http://www.boxever.com/).
+
+This product includes software developed at
+SoundCloud Ltd. (http://soundcloud.com/).
+
+This product includes software developed as part of the
+Ocelli project by Netflix Inc. (https://github.com/Netflix/ocelli/).
\ No newline at end of file
diff --git a/solr/licenses/simpleclient_common-0.2.0.jar.sha1 b/solr/licenses/simpleclient_common-0.2.0.jar.sha1
new file mode 100644
index 00000000000..1e1c2e94733
--- /dev/null
+++ b/solr/licenses/simpleclient_common-0.2.0.jar.sha1
@@ -0,0 +1 @@
+42d513358b26ae44137c620fa517d37b5e707ae1
diff --git a/solr/licenses/simpleclient_common-LICENSE-ASL.txt b/solr/licenses/simpleclient_common-LICENSE-ASL.txt
new file mode 100644
index 00000000000..261eeb9e9f8
--- /dev/null
+++ b/solr/licenses/simpleclient_common-LICENSE-ASL.txt
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
diff --git a/solr/licenses/simpleclient_common-NOTICE.txt b/solr/licenses/simpleclient_common-NOTICE.txt
new file mode 100644
index 00000000000..cbd3cd95bef
--- /dev/null
+++ b/solr/licenses/simpleclient_common-NOTICE.txt
@@ -0,0 +1,11 @@
+Prometheus instrumentation library for JVM applications
+Copyright 2012-2015 The Prometheus Authors
+
+This product includes software developed at
+Boxever Ltd. (http://www.boxever.com/).
+
+This product includes software developed at
+SoundCloud Ltd. (http://soundcloud.com/).
+
+This product includes software developed as part of the
+Ocelli project by Netflix Inc. (https://github.com/Netflix/ocelli/).
\ No newline at end of file
diff --git a/solr/licenses/simpleclient_httpserver-0.2.0.jar.sha1 b/solr/licenses/simpleclient_httpserver-0.2.0.jar.sha1
new file mode 100644
index 00000000000..7d188b52e3f
--- /dev/null
+++ b/solr/licenses/simpleclient_httpserver-0.2.0.jar.sha1
@@ -0,0 +1 @@
+f644860c08c787821c8c7ce78c408cea187fe1a3
diff --git a/solr/licenses/simpleclient_httpserver-LICENSE-ASL.txt b/solr/licenses/simpleclient_httpserver-LICENSE-ASL.txt
new file mode 100644
index 00000000000..261eeb9e9f8
--- /dev/null
+++ b/solr/licenses/simpleclient_httpserver-LICENSE-ASL.txt
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
diff --git a/solr/licenses/simpleclient_httpserver-NOTICE.txt b/solr/licenses/simpleclient_httpserver-NOTICE.txt
new file mode 100644
index 00000000000..cbd3cd95bef
--- /dev/null
+++ b/solr/licenses/simpleclient_httpserver-NOTICE.txt
@@ -0,0 +1,11 @@
+Prometheus instrumentation library for JVM applications
+Copyright 2012-2015 The Prometheus Authors
+
+This product includes software developed at
+Boxever Ltd. (http://www.boxever.com/).
+
+This product includes software developed at
+SoundCloud Ltd. (http://soundcloud.com/).
+
+This product includes software developed as part of the
+Ocelli project by Netflix Inc. (https://github.com/Netflix/ocelli/).
\ No newline at end of file
diff --git a/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/grafana-solr-dashboard.png b/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/grafana-solr-dashboard.png
new file mode 100644
index 00000000000..69f21a4debb
Binary files /dev/null and b/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/grafana-solr-dashboard.png differ
diff --git a/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/solr-exporter-diagram.png b/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/solr-exporter-diagram.png
new file mode 100644
index 00000000000..96efece464d
Binary files /dev/null and b/solr/solr-ref-guide/src/images/monitoring-solr-with-prometheus-and-grafana/solr-exporter-diagram.png differ
diff --git a/solr/solr-ref-guide/src/monitoring-solr-with-prometheus-and-grafana.adoc b/solr/solr-ref-guide/src/monitoring-solr-with-prometheus-and-grafana.adoc
new file mode 100644
index 00000000000..0d5295b9cc5
--- /dev/null
+++ b/solr/solr-ref-guide/src/monitoring-solr-with-prometheus-and-grafana.adoc
@@ -0,0 +1,288 @@
+= Monitoring Solr with Prometheus and Grafana
+// 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.
+
+You can monitor Solr using solr-exporter that exposes Solr's metrics to https://prometheus.io[Prometheus], and visualize metrics using https://grafana.com[Grafana].
+
+It allows users to monitor not only Solr metrics which come from <> but also facet counts which come from <>.
+
+.solr-exporter Diagram
+image::images/monitoring-solr-with-prometheus-and-grafana/solr-exporter-diagram.png[image,width=600]
+
+This feature is experimental status.
+
+== Running solr-exporter
+
+You can start solr-exporter by running `./bin/solr-exporter` from the solr-exporter directory.
+
+[source,plain]
+----
+$ cd ./contrib/prometheus-exporter
+$ ./bin/solr-exporter -p 9983 -b http://localhost:8983/solr -f ./conf/solr-exporter-config.xml -n 8
+----
+
+If you are on Windows platform, you can start solr-exporter by running `.\bin\solr-exporter.cmd` instead.
+
+[source,plain]
+----
+> cd .\contrib\prometheus
+> .\bin\solr-exporter.cmd -p 9983 -b http://localhost:8983/solr -f .\conf\solr-exporter-config.xml -n 8
+----
+
+You can also connect to Solr in SolrCloud mode like this.
+
+[source,plain]
+----
+$ cd ./contrib/prometheus
+$ ./bin/solr-exporter -p 9983 -z localhost:2181/solr -f ./conf/solr-exporter-config.xml -n 16
+----
+
+See command help:
+
+[source,plain]
+----
+$ ./bin/solr-exporter -h
+usage: SolrCollector [-h] [-v] [-p PORT] [-b BASE_URL] [-z ZK_HOST] [-f CONFIG]
+ [-n NUM_THREADS]
+
+Prometheus exporter for Apache Solr.
+
+optional arguments:
+ -h, --help show this help message and exit
+ -p PORT, --port PORT solr-exporter listen port
+ -b BASE_URL, --baseurl BASE_URL
+ specify Solr base URL when connecting to Solr in standalone mode (for
+ example 'http://localhost:8983/solr')
+ -z ZK_HOST, --zkhost ZK_HOST
+ specify ZooKeeper connection string when connecting to Solr in
+ SolrCloud mode (for example 'localhost:2181/solr')
+ -f CONFIG, --config-file CONFIG
+ specify configuration file
+ -n NUM_THREADS, --num-thread NUM_THREADS
+ specify number of threads
+----
+
+The Solr's metrics exposed by solr-exporter can see at the following URL.
+
+http://localhost:9983/metrics[http://localhost:9983/metrics]
+
+
+== solr-exporter Configuration
+
+The configuration is in `./config/solr-exporter-config.xml`. An example with all possible options:
+
+[source,xml]
+----
+
+
+
+
+
+
+
+ /admin/ping
+
+
+
+ . 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
+ }
+
+
+
+
+
+
+
+
+ /admin/metrics
+
+ all
+ all
+
+
+
+
+
+
+
+ .metrics["solr.jetty"] | to_entries | .[] | select(.key | startswith("org.eclipse.jetty.server.handler.DefaultHandler")) | select(.key | endswith("xx-responses")) as $object |
+ $object.key | split(".") | last | split("-") | first as $status |
+ $object.value.count as $value |
+ {
+ name : "solr_metrics_jetty_response_total",
+ type : "COUNTER",
+ help : "See following URL: https://lucene.apache.org/solr/guide/metrics-reporting.html",
+ label_names : ["status"],
+ label_values : [$status],
+ value : $value
+ }
+
+
+...
+
+
+
+
+
+
+
+
+ /admin/collections
+
+ CLUSTERSTATUS
+
+
+
+
+ .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
+ }
+
+
+...
+
+
+
+
+
+
+
+
+ collection1
+ /select
+
+ *:*
+ 0
+ 0
+
+ {
+ category: {
+ type: terms,
+ field: cat
+ }
+ }
+
+
+
+
+
+ .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
+ }
+
+
+
+
+
+
+
+
+----
+
+|===
+|Name|Description
+
+|ping|Scrape <> response.
+|metrics|Scrape <> response.
+|collections|Scrape <> response.
+|search|Scrape <> response.
+|*.query|Query parameter for each features. You can specify `collection`, `core`, `path`, and `params`.
+|*.jsonQueries|JSON Query that is jq syntax. For more details, see https://stedolan.github.io/jq/manual/[https://stedolan.github.io/jq/manual/].
+|===
+
+jq query has to output JSON in the following format.
+
+[source,json]
+----
+{
+ name : "solr_ping",
+ type : "GAUGE",
+ help : "See following URL: https://lucene.apache.org/solr/guide/ping.html",
+ label_names : ["base_url","core"],
+ label_values : ["http://localhost:8983/solr","collection1"],
+ value : 1.0
+}
+----
+
+It will be converted to the following exposition format.
+
+[source,plain]
+----
+# TYPE solr_ping gauge
+# HELP solr_ping See following URL: https://lucene.apache.org/solr/guide/ping.html
+solr_ping{base_url="http://localhost:8983/solr",core="collection1"} 1.0
+----
+
+|===
+|Name|Description
+
+|name|The metric name to set. For more details, see https://prometheus.io/docs/practices/naming/[https://prometheus.io/docs/practices/naming/].
+|type|The type of the metric, can be `COUNTER`, `GAUGE`, `SUMMARY`, `HISTOGRAM` or `UNTYPED`. For more detauils, see https://prometheus.io/docs/concepts/metric_types/[https://prometheus.io/docs/concepts/metric_types/].
+|help|Help text for the metric.
+|label_names|Label names for the metric. For more details, see https://prometheus.io/docs/practices/naming/[https://prometheus.io/docs/practices/naming/].
+|label_values|Label values for the metric. For more details, see https://prometheus.io/docs/practices/naming/[https://prometheus.io/docs/practices/naming/].
+|value|Value for the metric. Value must be set to Double type.
+|===
+
+
+== Prometheus Configuration
+
+You need to specify the solr-exporter listen address into `scrape_configs` in `prometheus.yml`. See following example:
+
+[source,plain]
+----
+scrape_configs:
+ - job_name: 'solr'
+ static_configs:
+ - targets: ['localhost:9983']
+----
+
+When you apply the above settings to prometheus, it will start to pull Solr's metrics from solr-exporter.
+
+
+== Grafana Dashboard
+
+A Grafana sample dashboard is provided at the following JSON file.
+
+`./contrib/prometheus-exporter/conf/grafana-solr-dashboard.json`
+
+.Grafana Dashboard
+image::images/monitoring-solr-with-prometheus-and-grafana/grafana-solr-dashboard.png[image,width=800]
diff --git a/solr/solr-ref-guide/src/monitoring-solr.adoc b/solr/solr-ref-guide/src/monitoring-solr.adoc
index 0576e537ccd..2fb70775968 100644
--- a/solr/solr-ref-guide/src/monitoring-solr.adoc
+++ b/solr/solr-ref-guide/src/monitoring-solr.adoc
@@ -1,5 +1,5 @@
= Monitoring Solr
-:page-children: metrics-reporting, mbean-request-handler, configuring-logging, using-jmx-with-solr, performance-statistics-reference
+:page-children: metrics-reporting, mbean-request-handler, configuring-logging, using-jmx-with-solr, monitoring-solr-with-prometheus-and-grafana, performance-statistics-reference
// 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
@@ -30,6 +30,8 @@ Common administrative tasks include:
<>: Describes how to use Java Management Extensions with Solr.
+<>: Describes how to monitor Solr with Prometheus and Grafana.
+
<>: Additional information on statistics returned from JMX.