Sign inSign up

pwillie/prometheus-es-adapter

By pwillie

•Updated over 6 years ago

Prometheus remote storage adapter for Elasticsearch

Image
1

100K+

pwillie/prometheus-es-adapter repository overview

⁠prometheus-es-adapter

Please note: This project is no longer under active development.

⁠Overview

A read and write adapter for prometheus persistent storage.

⁠Exposed Endpoints
PortPathDescription
8000/readPrometheus remote read endpoint
8000/writePrometheus remote write endpoint
9000/metricsSurface Prometheus metrics
9000/liveHttp probe endpoint to reflect service liveness
9000/readyHttp probe endpoint reflecting the connection to and state of the Elasticsearch cluster

⁠Config

Env VariablesDefaultDescription
ES_URLhttp://localhost:9200⁠Elasticsearch URL
ES_USERElasticsearch User
ES_PASSWORDElasticsearch User Password
ES_WORKERS1Number of batch workers
ES_BATCH_MAX_AGE10Max period in seconds between bulk Elasticsearch insert operations
ES_BATCH_MAX_DOCS1000Max items for bulk Elasticsearch insert operation
ES_BATCH_MAX_SIZE4096Max size in bytes for bulk Elasticsearch insert operation
ES_ALIASprom-metricsElasticsearch alias pointing to active write index
ES_INDEX_DAILYfalseCreate daily indexes and disable index rollover
ES_INDEX_SHARDS5Number of Elasticsearch shards to create per index
ES_INDEX_REPLICAS1Number of Elasticsearch replicas to create per index
ES_INDEX_MAX_AGE7dMax age of Elasticsearch index before rollover
ES_INDEX_MAX_DOCS1000000Max number of docs in Elasticsearch index before rollover
ES_INDEX_MAX_SIZEMax size of index before rollover eg 5gb
ES_SEARCH_MAX_DOCS1000Max number of docs returned for Elasticsearch search operation
ES_SNIFFfalseEnable Elasticsearch sniffing
STATStrueExpose Prometheus metrics endpoint
DEBUGfalseDisplay extra debug logs

⁠Notes

Although prometheus-es-adapter will create and rollover Elasticsearch indicies it is expected that a tool such as Elasticsearch Curator will be used to maintain quiescent indicies eg deleting, shrinking and merging old indexes.

⁠Requirements

  • 6.x Elastisearch cluster

⁠Getting started

Automated builds of Docker image are available at https://hub.docker.com/r/pwillie/prometheus-es-adapter/⁠.

⁠Contributing

Local development requires Go to be installed. On OS X with Homebrew you can just run brew install go.

Running it then should be as simple as:

$ make build
$ ./bin/prometheus-es-adapter
⁠Testing

make test

⁠e2e

To run end to end tests using docker-compose, from the "test" directory:

docker-compose up -d
docker-compose ps
docker-compose up -d --build prometheus-es-adapter
docker-compose logs -f prometheus-es-adapter

Tag summary

Content type

Image

Digest

Size

10.4 MB

Last updated

over 6 years ago

docker pull pwillie/prometheus-es-adapter