From 63177b8675b7dd2db6eb588ecebdbbcbc960f7cd Mon Sep 17 00:00:00 2001 From: Dominik Schulz Date: Wed, 28 Jun 2017 21:44:48 +0200 Subject: [PATCH] Tag 1.0.0-rc1 --- .promu.yml | 29 +++++++++++++ Makefile | 8 ++++ README.md | 61 +++++++++++++------------- VERSION | 2 +- examples/kubernetes/deployment.yml | 69 ++++++++++++++++++++++++++++++ 5 files changed, 138 insertions(+), 31 deletions(-) create mode 100644 examples/kubernetes/deployment.yml diff --git a/.promu.yml b/.promu.yml index 822ec4a0..ebe8f618 100644 --- a/.promu.yml +++ b/.promu.yml @@ -5,6 +5,7 @@ repository: build: flags: -a -tags netgo ldflags: | + -s -X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}} -X {{repoPath}}/vendor/github.com/prometheus/common/version.Revision={{.Revision}} -X {{repoPath}}/vendor/github.com/prometheus/common/version.Branch={{.Branch}} @@ -13,3 +14,31 @@ build: tarball: files: - LICENSE + - README.md + - examples/grafana/dashboard.json + - examples/kubernetes/deployment.yml + - examples/prometheus/elasticsearch.rules +crossbuild: + platforms: + - linux/amd64 + - linux/386 + - darwin/amd64 + - darwin/386 + - windows/amd64 + - windows/386 + - freebsd/amd64 + - freebsd/386 + - openbsd/amd64 + - openbsd/386 + - netbsd/amd64 + - netbsd/386 + - dragonfly/amd64 + - linux/arm + - linux/arm64 + - freebsd/arm + - openbsd/arm + - netbsd/arm + - linux/ppc64 + - linux/ppc64le + - linux/mips64 + - linux/mips64le diff --git a/Makefile b/Makefile index c5b7622a..236c4e9c 100644 --- a/Makefile +++ b/Makefile @@ -43,10 +43,18 @@ build: promu @echo ">> building binaries" @$(PROMU) build --prefix $(PREFIX) +crossbuild: promu + @echo ">> cross-building binaries" + @$(PROMU) crossbuild + tarball: promu @echo ">> building release tarball" @$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) +tarballs: promu + @echo ">> building release tarballs" + @$(PROMU) tarballs --prefix $(PREFIX) $(BIN_DIR) + docker: @echo ">> building docker image" @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . diff --git a/README.md b/README.md index d5ad4849..d00f4462 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,20 @@ https://github.com/justwatchcom/elasticsearch_exporter/releases #### Docker ```bash -docker pull justwatch/elasticsearch_exporter:0.3.2 -docker run --rm -p 9108:9108 justwatch/elasticsearch_exporter:0.3.2 +docker pull justwatch/elasticsearch_exporter:1.0.0-rc1 +docker run --rm -p 9108:9108 justwatch/elasticsearch_exporter:1.0.0-rc1 +``` + +Example `docker-compose.yml`: + +```yaml +elasticsearch_exporter: + image: justwatch/elasticsearch_exporter:1.0.0-rc1 + environment: + - '-es.uri=http://elasticsearch:9200' + restart: always + ports: + - "127.0.0.1:9108:9108" ``` ### Configuration @@ -24,7 +36,7 @@ elasticsearch_exporter --help | Argument | Description | | -------- | ----------- | -| es.uri | Address (host and port) of the Elasticsearch node we should connect to. This could be a local node (`localhost:8500`, for instance), or the address of a remote Elasticsearch server. +| es.uri | Address (host and port) of the Elasticsearch node we should connect to. This could be a local node (`localhost:9200`, for instance), or the address of a remote Elasticsearch server. | es.all | If true, query stats for all nodes in the cluster, rather than just the node we connect to. | es.timeout | Timeout for trying to get stats from Elasticsearch. (ex: 20s) | | es.ca | Path to PEM file that contains trusted CAs for the Elasticsearch connection. @@ -33,11 +45,6 @@ elasticsearch_exporter --help | web.listen-address | Address to listen on for web interface and telemetry. | | web.telemetry-path | Path under which to expose metrics. | -__NOTE:__ We support pulling stats for all nodes at once, but in production -this is unlikely to be the way you actually want to run the system. It is much -better to run an exporter on each Elasticsearch node to remove a single point -of failure and improve the connection between operation and reporting. - ### Metrics |Name |Type |Cardinality |Help @@ -119,36 +126,30 @@ of failure and improve the connection between operation and reporting. | elasticsearch_transport_rx_size_bytes_total | counter | 1 | Total number of bytes received | elasticsearch_transport_tx_packets_total | counter | 1 | Count of packets sent | elasticsearch_transport_tx_size_bytes_total | counter | 1 | Total number of bytes sent -### Alerts & Recording Rules -As example alerts and recording rules I have copied my `.rules` file to this repository. -Please check [elasticsearch.rules](examples/prometheus/elasticsearch.rules) in the examples folder. +### Alerts & Recording Rules -### Development +We provide examples for [Prometheus](http://prometheus.io) [alerts and recording rules](examples/prometheus/elasticsearch.rules) as well as an [Grafana](http://www.grafana.org) [Dashboard](examples/grafana/dashboard.json) and a [Kubernetes](http://kubernetes.io) [Deployment](examples/kubernetes/deployment.yml). -You obviously should get the code +## Credit & License -```bash -go get -u github.com/justwatchcom/elasticsearch_exporter -``` +`elasticsearch_exporter` is maintained by the nice folks from [JustWatch](https://www.justwatch.com/) +and licensed under the terms of the Apache license. -Now during development I always run: +This package was originally created and mainted by [Eric Richardson](https://github.com/ewr), +who transferred this repository to us in January 2017. -```bash -make build && ./elasticsearch_exporter -``` +Maintainers of this repository: -### Elasticsearch 2.0 +* Matthias Loibl @metalmatze +* Dominik Schulz @dominikschulz -Parts of the node stats struct changed for Elasticsearch 2.0. For the moment -we'll attempt to report important values for both. +Please refer to the Git commit log for a complete list of contributors. -* `indices.filter_cache` becomes `indices.query_cache` -* `indices.query_cache` becomes `indices.request_cache` -* `process.cpu` lost `user` and `sys` time, so we're now reporting `total` -* Added `process.cpu.max_file_descriptors` +## Contributing -### Original author +We welcome any contributions. Please fork the project on GitHub and open +Pull Requests for any proposed changes. -This package was originally created and mainted by [Eric Richardson](https://github.com/ewr), -who transferred this repository to us in January 2017. \ No newline at end of file +Please note that we will not merge any changes that encourage insecure +behaviour. If in doubt please open an Issue first to discuss your proposal. diff --git a/VERSION b/VERSION index d15723fb..867bf6ba 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.2 +1.0.0-rc1 diff --git a/examples/kubernetes/deployment.yml b/examples/kubernetes/deployment.yml new file mode 100644 index 00000000..e13b48b0 --- /dev/null +++ b/examples/kubernetes/deployment.yml @@ -0,0 +1,69 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: p8s-elastic-exporter +spec: + replicas: 1 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + type: RollingUpdate + template: + metadata: + annotations: + prometheus.io/port: "9108" + prometheus.io/scrape: "true" + labels: + app: p8s-elastic-exporter + spec: + securityContext: + runAsNonRoot: true + runAsUser: 1000 + containers: + - command: + - /bin/elasticsearch_exporter + - -es.uri=http://elasticsearch:9200 + - -es.all=true + image: juswatch/elasticsearch_exporter:0.3.3 + securityContext: + capabilities: + drop: + - SETPCAP + - MKNOD + - AUDIT_WRITE + - CHOWN + - NET_RAW + - DAC_OVERRIDE + - FOWNER + - FSETID + - KILL + - SETGID + - SETUID + - NET_BIND_SERVICE + - SYS_CHROOT + - SETFCAP + readOnlyRootFilesystem: true + livenessProbe: + httpGet: + path: /health + port: 9108 + initialDelaySeconds: 30 + timeoutSeconds: 10 + name: p8s-elastic-exporter + ports: + - containerPort: 9108 + readinessProbe: + httpGet: + path: /health + port: 9108 + initialDelaySeconds: 10 + timeoutSeconds: 10 + resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 25m + memory: 64Mi + restartPolicy: Always