Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added few missing metrics #34

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
54 changes: 54 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [master]
tags:
- "*"
pull_request:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

strategy:
matrix:
os: [linux, darwin]
arch: [amd64, arm64]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Setup Go environment
uses: actions/[email protected]
with:
go-version: 1.17

- name: Build executable
run: make build_${{ matrix.os }}_${{ matrix.arch }}

- name: compress executable
run: |
cd bin/${{ matrix.os }}/${{ matrix.arch }}
chmod +x logstash_exporter
zip logstash_exporter-${{ matrix.os }}_${{ matrix.arch }}.zip logstash_exporter

- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
generate_release_notes: true
repository: wasilak/logstash_exporter
files: |
bin/**/logstash_exporter*.zip
4 changes: 2 additions & 2 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
go:
cgo: false
repository:
path: github.com/BonnierNews/logstash_exporter
path: github.com/wasilak/logstash_exporter
build:
binaries:
- name: logstash_exporter
flags: -i -tags 'netgo static_build'
flags: -tags 'netgo static_build'
ldflags: |
-s
-X {{repoPath}}/vendor/github.com/prometheus/common/version.Version={{.Version}}
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM golang:1.9 as golang

ADD . $GOPATH/src/github.com/BonnierNews/logstash_exporter/
ADD . $GOPATH/src/github.com/wasilak/logstash_exporter/
RUN curl -fsSL -o /usr/local/bin/dep https://github.com/golang/dep/releases/download/v0.3.2/dep-linux-amd64 && \
chmod +x /usr/local/bin/dep && \
go get -u github.com/BonnierNews/logstash_exporter && \
cd $GOPATH/src/github.com/BonnierNews/logstash_exporter && \
go get -u github.com/wasilak/logstash_exporter && \
cd $GOPATH/src/github.com/wasilak/logstash_exporter && \
dep ensure && \
make

FROM busybox:1.27.2-glibc
COPY --from=golang /go/src/github.com/BonnierNews/logstash_exporter/logstash_exporter /
COPY --from=golang /go/src/github.com/wasilak/logstash_exporter/logstash_exporter /
LABEL maintainer [email protected]
EXPOSE 9198
ENTRYPOINT ["/logstash_exporter"]
24 changes: 21 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,27 @@ gometalinter: $(GOLINTER)
@$(GOLINTER) --install --update > /dev/null
@$(GOLINTER) --config=./.gometalinter.json ./...

build: $(PROMU)
@echo ">> building binaries"
@$(PROMU) build --prefix $(PREFIX)
build: build_linux_amd64 build_linux_arm64 build_darwin_amd64 build_darwin_arm64

build_linux_amd64: $(PROMU)
@echo ">> building binaries for amd64"
@mkdir -p $(PREFIX)/bin/linux/amd64
@GOOS=linux GOARCH=amd64 $(PROMU) build --prefix $(PREFIX)/bin/linux/amd64 logstash_exporter

build_linux_arm64: $(PROMU)
@echo ">> building binaries for arm64"
@mkdir -p $(PREFIX)/bin/linux/arm64
@GOOS=linux GOARCH=arm64 $(PROMU) build --prefix $(PREFIX)/bin/linux/arm64 logstash_exporter

build_darwin_amd64: $(PROMU)
@echo ">> building binaries for amd64"
@mkdir -p $(PREFIX)/bin/darwin/amd64
@GOOS=darwin GOARCH=amd64 $(PROMU) build --prefix $(PREFIX)/bin/darwin/amd64 logstash_exporter

build_darwin_arm64: $(PROMU)
@echo ">> building binaries for arm64"
@mkdir -p $(PREFIX)/bin/darwin/arm64
@GOOS=darwin GOARCH=arm64 $(PROMU) build --prefix $(PREFIX)/bin/darwin/arm64 logstash_exporter

clean:
@echo ">> Cleaning up"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Prometheus exporter for the metrics available in Logstash since version 5.0.
## Usage

```bash
go get -u github.com/BonnierNews/logstash_exporter
cd $GOPATH/src/github.com/BonnierNews/logstash_exporter
go get -u github.com/wasilak/logstash_exporter
cd $GOPATH/src/github.com/wasilak/logstash_exporter
make
./logstash_exporter -exporter.bind_address :1234 -logstash.endpoint http://localhost:1235
```
Expand Down
File renamed without changes.
22 changes: 22 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module github.com/wasilak/logstash_exporter

go 1.17

require (
github.com/prometheus/client_golang v1.11.0
github.com/prometheus/common v0.32.1
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)

require (
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
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/procfs v0.7.3 // indirect
golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect
google.golang.org/protobuf v1.27.1 // indirect
)
Loading