Add more metrics to the solr exporter configuration.

This commit is contained in:
Andrea Dell'Amico 2018-07-12 19:18:35 +02:00
parent 22438d0882
commit c8e30aa4c8
2 changed files with 171 additions and 0 deletions

View File

@ -70,6 +70,7 @@
- name: Install the Solr prometheus exporter config file
template: src=solr-exporter-config.xml dest={{ solr_prometheus_conf_file }} mode=0644
notify: Restart Solr prometheus exporter
tags: [ 'solr', 'solr_prometheus', 'solr_prometheus_exporter', 'solr_prometheus_exporter_config' ]
- name: Install the Solr prometheus exporter upstart script
template: src=solr_prometheus_exporter.upstart.j2 dest=/etc/init/solr_prometheus_exporter.conf mode=0644 owner=root group=root

View File

@ -1636,6 +1636,176 @@
}
end
</str>
<str>
.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.meanRate as $value |
if $parent_key_item_len == 3 then
{
name: "solr_metrics_core_requests_meanrate_seconds",
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_requests_meanrate",
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
</str>
<str>
.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."1minRate" as $value |
if $parent_key_item_len == 3 then
{
name: "solr_metrics_core_requests_1minrate_seconds",
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_requests_1minrate",
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
</str>
<str>
.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."5minRate" as $value |
if $parent_key_item_len == 3 then
{
name: "solr_metrics_core_requests_5minrate_seconds",
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_requests_5minrate",
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
</str>
<str>
.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."15minRate" as $value |
if $parent_key_item_len == 3 then
{
name: "solr_metrics_core_requests_15minrate",
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_requests_15minrate_seconds",
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
</str>
<str>
.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.mean_ms / 1000 as $value |
if $parent_key_item_len == 3 then
{
name: "solr_metrics_core_requests_mean_time_seconds",
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_requests_mean_time_seconds",
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
</str>
</arr>
</lst>
</metrics>