App::ElasticSearch::Utilities::Metrics - Fetches performance metrics about the node
version 8.8
This provides a simple API to export some core metrics from the local ElasticSearch instance.
use App::ElasticSearch::Utilities qw(es_connect); use App::ElasticSearch::Utilities::Metrics; my $metrics_fetcher = App::ElasticSearch::Utilities::Metrics->new( connection => es_connect(), with_cluster_metrics => 1, with_index_metrics => 1, ); my $metrics = $metrics_fetcher->get_metrics();
An `App::ElasticSearch::Utilities::Connection` instance, or automatically created via es_connect().
es_connect()
An array of metric names to ignore, in addition to the static list when parsing the `_node/_local/stats` stats. Defaults to:
[qw(adaptive_selection discovery)]
Plus ignores sections containing ingest, ml, transform UNLESS those roles appear in the node's roles. Also, unless the node is tagged as a data* node, the following keys are ignored:
ingest
ml
transform
data*
[qw(force_merge indexing indices merges pressure recovery segments translog)]
The Node details provided by the _nodes/_local API.
_nodes/_local
The Node ID for the connection, will be automatically discovered
Boolean, set to true to collect cluster metrics in addition to node metrics
Boolean, set to true to collect index level metrics in addition to node metrics
Retrieves the metrics from the local node.
Returns all relevant stats from the _nodes/_local API
Return all relevant stats from the _cluster/health API as well as a count of `index.blocks.*` in place.
_cluster/health
This method totals the shard, and segment state and size for the current node by index base name.
Brad Lhotsky <brad@divisionbyzero.net>
This software is Copyright (c) 2024 by Brad Lhotsky.
This is free software, licensed under:
The (three-clause) BSD License
To install App::ElasticSearch::Utilities, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::ElasticSearch::Utilities
CPAN shell
perl -MCPAN -e shell install App::ElasticSearch::Utilities
For more information on module installation, please visit the detailed CPAN module installation guide.