Once installed, you can run the exporter with the prometheus-es-exporter command.īy default, it will bind to port 9206, query Elasticsearch on localhost:9200 and run queries configured in a file exporter.cfg in the working directory. Note that you may need to add the start script location (see pip output) to your PATH. To install the latest published version via Pip, run: > pip3 install prometheus-es-exporter The exporter requires Python 3 and Pip 3 to be installed. _id), so may be slightly lower than the field count used by Elasticsearch to check the field limit. Note that these counts don't include system fields (ones prefixed with _, e.g. sum(es_indices_mappings_field_count) by(index) > 900 Useful for checking if an index is at risk of reaching a field limit, e.g. Sum by index to calculate the total fields per index. The number of mapped fields of a given type in an index. The exporter also produces the following metrics: es_indices_aliases_alias (gauge) See tests/test_cluster_health_parser.py, tests/test_nodes_stats_parser.py, and tests/test_indices_stats_parser.py for examples of responses and the metrics produced. If you spot something you think can be reasonably improved let me know via a Github issue (or better yet - a PR). redundancy between some metrics, no distinction between gauges and counters (everything's a gauge). This results in less than ideal metrics in some cases - e.g. The exporter queries the Elasticsearch cluster's _cluster/health, _nodes/stats, and _stats endpoints whenever its metrics endpoint is called, and exports the results as Prometheus gauge metrics.Įndpoint responses are parsed into metrics as generically as possible so that (hopefully) all versions of Elasticsearch (past and future) can be reasonably supported with the same code. Extracting metrics from arbitrary documents is out of scope for this exporter due to the complexities involved. The top_hits aggregation returns documents, not metrics about documents. Some aggregations are explicitly unsupported - they don't work correctly, and this can't/won't be fixed for some reason. If you would like to use a particular aggregation but it is not working correctly (and it isn't explicitly unsupported), please raise an issue or PR. Most other aggregations should also work, so long as their result format is similar in structure to one of the explicitly supported aggregations. See tests/test_parser.py for example queries using these aggregations, and the metrics they produce. Supported AggregationsĪ limited set of aggregations are explicitly supported with tests. The keys of any buckets are converted to labels, rather than being inserted into the metric name. Metrics are only extracted from aggregation results, with the exception of the query hits.total count (exposed as hits) and took time (exposed as took_milliseconds). Values are parsed out of the Elasticsearch results automatically, with the path through the JSON to the value being used to construct metric names. The exporter periodically runs configured queries against the Elasticsearch cluster and exports the results as Prometheus gauge metrics. Source Code | Python Package | Docker Image | Helm Chart Query Metrics This Prometheus exporter collects metrics from queries run on an Elasticsearch cluster's data, and metrics about the cluster itself.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |