Skip to content

Commit

Permalink
Include DEB+RPM package in release
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Apr 26, 2020
1 parent 78a506a commit f0f153c
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
17 changes: 17 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,20 @@ dockers:
- prometheus-nginxlog-exporter
goos: linux
goarch: amd64
nfpms:
- vendor: Martin Helmich
homepage: https://github.com/martin-helmich/prometheus-nginxlog-exporter
description: Export Prometheus metrics from NGINX (or compatible) log files
license: Apache 2.0
formats:
- deb
- rpm
dependencies:
- systemd
bindir: /usr/sbin
files:
res/package/prometheus-nginxlog-exporter.service: /lib/systemd/system/prometheus-nginxlog-exporter.service
config_files:
res/package/default-config.hcl: /etc/prometheus-nginxlog-exporter.hcl
scripts:
postinstall: res/package/scripts/postinstall.sh
1 change: 1 addition & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ image:https://img.shields.io/github/workflow/status/martin-helmich/prometheus-ng
image:https://quay.io/repository/martinhelmich/prometheus-nginxlog-exporter/status[link="https://quay.io/repository/martinhelmich/prometheus-nginxlog-exporter",Docker Repository on Quay]
image:https://goreportcard.com/badge/github.com/martin-helmich/prometheus-nginxlog-exporter[link="https://goreportcard.com/report/github.com/martin-helmich/prometheus-nginxlog-exporter", Go Report Card]
image:https://img.shields.io/github/license/martin-helmich/prometheus-nginxlog-exporter[GitHub]
image:https://img.shields.io/badge/donate-PayPal-yellow[link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=SEARYHPVS9U5N&source=url", Donate]

Helper tool that continuously reads an NGINX log file and exports metrics to https://prometheus.io/[Prometheus].

Expand Down
17 changes: 17 additions & 0 deletions res/package/default-config.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
listen {
port = 4040
}

namespace "nginx" {
source = {
files = [
"/var/log/nginx/access.log"
]
}

format = "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$http_x_forwarded_for\""

labels {
app = "default"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=NGINX metrics exporter for Prometheus
After=network-online.target

[Service]
ExecStart=/usr/local/bin/prometheus-nginxlog-exporter -config-file /etc/prometheus-nginxlog-exporter.hcl
ExecStart=/usr/sbin/prometheus-nginxlog-exporter -config-file /etc/prometheus-nginxlog-exporter.hcl
Restart=always
ProtectSystem=full
CapabilityBoundingSet=
Expand Down
4 changes: 4 additions & 0 deletions res/package/scripts/postinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

systemctl daemon-reload
systemctl enable prometheus-nginxlog-exporter

0 comments on commit f0f153c

Please sign in to comment.