From 80f1d45a18b01cab9b57d268579be14d059d11fd Mon Sep 17 00:00:00 2001 From: Jonathan Ballet Date: Mon, 13 May 2024 19:44:39 +0200 Subject: [PATCH 1/2] Add missing documentation for ILM metrics Signed-off-by: Jonathan Ballet --- README.md | 2 ++ collector/ilm_status.go | 2 +- collector/ilm_status_test.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ec2d244a..0b78e76c 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,8 @@ Further Information | elasticsearch_filesystem_io_stats_device_write_operations_count | gauge | 1 | Count of disk write operations | | elasticsearch_filesystem_io_stats_device_read_size_kilobytes_sum | gauge | 1 | Total kilobytes read from disk | | elasticsearch_filesystem_io_stats_device_write_size_kilobytes_sum | gauge | 1 | Total kilobytes written to disk | +| elasticsearch_ilm_status | gauge | 3 | Current status of ILM. Status can be `STOPPED`, `RUNNING`, `STOPPING`. | +| elasticsearch_ilm_index_status | gauge | | Status of ILM policy for index | | elasticsearch_indices_active_queries | gauge | 1 | The number of currently active queries | | elasticsearch_indices_docs | gauge | 1 | Count of documents on this node | | elasticsearch_indices_docs_deleted | gauge | 1 | Count of deleted documents on this node | diff --git a/collector/ilm_status.go b/collector/ilm_status.go index 57fda408..e1630e6c 100644 --- a/collector/ilm_status.go +++ b/collector/ilm_status.go @@ -63,7 +63,7 @@ func NewIlmStatus(logger log.Logger, client *http.Client, url *url.URL) *IlmStat Type: prometheus.GaugeValue, Desc: prometheus.NewDesc( prometheus.BuildFQName(namespace, subsystem, "status"), - "Current status of ilm. Status can be STOPPED, RUNNING, STOPPING.", + "Current status of ILM. Status can be STOPPED, RUNNING, STOPPING.", []string{"operation_mode"}, nil, ), Value: func(ilm *IlmStatusResponse, status string) float64 { diff --git a/collector/ilm_status_test.go b/collector/ilm_status_test.go index 56254ba9..ede82ddd 100644 --- a/collector/ilm_status_test.go +++ b/collector/ilm_status_test.go @@ -39,7 +39,7 @@ func TestILMStatus(t *testing.T) { name: "6.6.0", file: "../fixtures/ilm_status/6.6.0.json", want: ` -# HELP elasticsearch_ilm_status Current status of ilm. Status can be STOPPED, RUNNING, STOPPING. +# HELP elasticsearch_ilm_status Current status of ILM. Status can be STOPPED, RUNNING, STOPPING. # TYPE elasticsearch_ilm_status gauge elasticsearch_ilm_status{operation_mode="RUNNING"} 1 elasticsearch_ilm_status{operation_mode="STOPPED"} 0 From 444b54bb3e94a5ddce7fb49e352dc67398fef2c4 Mon Sep 17 00:00:00 2001 From: Jonathan Ballet Date: Tue, 14 May 2024 20:52:08 +0200 Subject: [PATCH 2/2] Document the --es.ilm flag Signed-off-by: Jonathan Ballet --- README.md | 1 + main.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0b78e76c..7cbe820c 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ elasticsearch_exporter --help | es.indices_settings | 1.0.4rc1 | If true, query settings stats for all indices in the cluster. | false | | es.indices_mappings | 1.2.0 | If true, query stats for mappings of all indices of the cluster. | false | | es.aliases | 1.0.4rc1 | If true, include informational aliases metrics. | true | +| es.ilm | 1.6.0 | If true, query index lifecycle policies for indices in the cluster. | es.shards | 1.0.3rc1 | If true, query stats for all indices in the cluster, including shard-level stats (implies `es.indices=true`). | false | | es.snapshots | 1.0.4rc1 | If true, query stats for the cluster snapshots. | false | | es.slm | | If true, query stats for SLM. | false | diff --git a/main.go b/main.go index 5e4c6da0..0ca6b6cf 100644 --- a/main.go +++ b/main.go @@ -78,7 +78,7 @@ func main() { "Export informational alias metrics."). Default("true").Bool() esExportILM = kingpin.Flag("es.ilm", - "Export index lifecycle politics for indices in the cluster."). + "Export index lifecycle policies for indices in the cluster."). Default("false").Bool() esExportShards = kingpin.Flag("es.shards", "Export stats for shards in the cluster (implies --es.indices).").