Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
- Change main module
- Update module `client_golang` (`v1.13.0` -> `v1.14.0`)
- Improve documentation
  • Loading branch information
LHozzan committed Jan 19, 2023
1 parent 11ade86 commit b7d51bd
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 23 deletions.
76 changes: 56 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,65 @@
Logstash exporter
=================
# Logstash exporter

Prometheus exporter for metrics provided by Node Stats API of Logstash.
Prometheus exporter for metrics provided by [Node Stats API](https://www.elastic.co/guide/en/logstash/current/monitoring-logstash.html) of Logstash.

Building and running
--------------------
## Building

go get gitlab.com/alxrem/prometheus-logstash-exporter
cd ${GOPATH-$HOME/go}/src/gitlab.com/alxrem/prometheus-logstash-exporter
go build
./prometheus-logstash-exporter <flags>
*Golang must be installed on the local machine!*

To see all available configuration flags:
```bash
$ git clone https://github.com/sap-contributions/prometheus-logstash-exporter.git
$ cd prometheus-logstash-exporter
$ CGO_ENABLED=0 go build -o prometheus-logstash-exporter
```

## Running

./prometheus-logstash-exporter -h

Packages
--------
```bash
./prometheus-logstash-exporter <flags>
```

Binary builds are available on the [releases page of Gitlab project](https://gitlab.com/alxrem/prometheus-logstash-exporter/-/releases).
*If you hold Logstash defaults, the Exporter follow them too.*

To see all available configuration flags:

Packages for latest Debian and Ubuntu releases are available on
[PackageCloud](https://packagecloud.io/alxrem/prometheus-logstash-exporter/).
```bash
$ ./prometheus-logstash-exporter -h
Usage of ./prometheus-logstash-exporter:
-logstash.host string
Host address of logstash server. (default "localhost")
-logstash.port int
Port of logstash server. (default "9600")
-logstash.timeout duration
Timeout to get stats from logstash server. (default "5s")
-web.listen-address string
Address to listen on for web interface and telemetry. (default ":9304")
-web.telemetry-path string
Path under which to expose metrics. (default "/metrics")
```

Docker images are available at [Docker Hub](https://hub.docker.com/r/alxrem/prometheus-logstash-exporter/).
Pull the latest version with
In Kubernetes we recommend deploy the Exporter as a sidecar in pod with Logstash.

docker pull alxrem/prometheus-logstash-exporter
E.g.:
```yaml
...
spec:
containers:
- name: logstash
(... setup for logstash ...)
- name: exporter
image: <PathToYourDockerContainerWithName>:<VersionForYourDockerContainer>
args:
- --web.listen-address=:9310 # by default is used port 9304, but feel free adapt this setting
ports:
- containerPort: 9310
name: metrics
protocol: TCP
resources:
requests:
cpu: "100m"
memory: "16M"
limits:
cpu: "200m"
memory: "32M"
...
```
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module gitlab.com/alxrem/prometheus-logstash-exporter
module github.com/sap-contributions/prometheus-logstash-exporter

go 1.19

require github.com/prometheus/client_golang v1.13.0
require github.com/prometheus/client_golang v1.14.0

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,15 @@ github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnY
github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY=
github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU=
github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ=
github.com/prometheus/client_golang v1.14.0 h1:nJdhIvne2eSX/XRAFV9PcvFFRbrjbcTUj0VP62TMhnw=
github.com/prometheus/client_golang v1.14.0/go.mod h1:8vpkKitgIVNcqrRBWh1C4TIUQgYNtG/XQE4E/Zae36Y=
github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo=
github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc=
Expand Down

0 comments on commit b7d51bd

Please sign in to comment.