summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSorah Fukumori2019-02-20 03:18:57 +0900
committerSorah Fukumori2019-02-20 03:18:57 +0900
commitf2f5f0cbeebcdeb9bdfe7b774a26cc364d7523f2 (patch)
tree08ef01032b4ce233bd572f87f9ab439efc6d74de
downloadaur-f2f5f0cbeebcdeb9bdfe7b774a26cc364d7523f2.tar.gz
initial submission
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD42
-rw-r--r--config.yml37
-rw-r--r--prometheus-exporter-proxy.service14
4 files changed, 112 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..24d6d269fb15
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = prometheus-exporter-proxy
+ pkgdesc = Simple reverse proxy for prometheus exporters
+ pkgver = 0.3.1
+ pkgrel = 1
+ url = https://github.com/rrreeeyyy/exporter_proxy
+ arch = x86_64
+ arch = aarch64
+ license = MIT
+ makedepends = go-pie
+ backup = etc/prometheus-exporter-proxy/config.yml
+ source = prometheus-exporter-proxy.service
+ source = config.yml
+ source = https://github.com/rrreeeyyy/exporter_proxy/archive/v0.3.1.tar.gz
+ sha512sums = 9f8a15df5a7e80179e0fee256462bbc55758732608d3e04d6657b4c8121dba183dee711dbc989fc18e84687120c5345c1587f47ecffbd2dc10186c00d0bdc79c
+ sha512sums = b844466870c3cc55427ba29717338d1e57dfe6a4edb71ce00b8982408c309b2f60bb66a0275362e5f615e7b7116bd9a138ad940cf18d9cfaed975ff9a12c8648
+ sha512sums = 59772eb7f2635fa2eedda6a9fd5ee07772ced009afe64f854e33f44ae9f280840d2c9f7365b4fb08a526bf30d463a67dd71e2623e311ef5a153898f17c35fae3
+
+pkgname = prometheus-exporter-proxy
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..021b0691e9a9
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Sorah Fukumori <her@sorah.jp>
+pkgname=prometheus-exporter-proxy
+pkgver=0.3.1
+pkgrel=1
+pkgdesc="Simple reverse proxy for prometheus exporters"
+arch=('x86_64' 'aarch64')
+url="https://github.com/rrreeeyyy/exporter_proxy"
+license=('MIT')
+makedepends=('go-pie')
+backup=('etc/prometheus-exporter-proxy/config.yml')
+source=(
+ "prometheus-exporter-proxy.service"
+ "config.yml"
+ "https://github.com/rrreeeyyy/exporter_proxy/archive/v${pkgver}.tar.gz"
+)
+
+prepare() {
+ mkdir -p gopath/src/github.com/rrreeeyyy
+ ln -rTsf "exporter_proxy-$pkgver" gopath/src/github.com/rrreeeyyy/exporter_proxy
+ export GOPATH="$srcdir"/gopath
+}
+
+build() {
+ export GOPATH="$srcdir"/gopath
+ cd gopath/src/github.com/rrreeeyyy/exporter_proxy
+
+ go build \
+ -gcflags "all=-trimpath=$GOPATH" \
+ -asmflags "all=-trimpath=$GOPATH" \
+ -ldflags "-extldflags $LDFLAGS" \
+ -o exporter-proxy .
+}
+
+package() {
+ cd "exporter_proxy-$pkgver"
+ install -Dm0755 exporter-proxy "${pkgdir}/usr/bin/prometheus-exporter-proxy"
+ install -Dm0644 "${srcdir}/prometheus-exporter-proxy.service" "${pkgdir}/usr/lib/systemd/system/prometheus-exporter-proxy.service"
+ install -Dm0644 "${srcdir}/config.yml" "${pkgdir}/etc/prometheus-exporter-proxy/config.yml"
+}
+sha512sums=('9f8a15df5a7e80179e0fee256462bbc55758732608d3e04d6657b4c8121dba183dee711dbc989fc18e84687120c5345c1587f47ecffbd2dc10186c00d0bdc79c'
+ 'b844466870c3cc55427ba29717338d1e57dfe6a4edb71ce00b8982408c309b2f60bb66a0275362e5f615e7b7116bd9a138ad940cf18d9cfaed975ff9a12c8648'
+ '59772eb7f2635fa2eedda6a9fd5ee07772ced009afe64f854e33f44ae9f280840d2c9f7365b4fb08a526bf30d463a67dd71e2623e311ef5a153898f17c35fae3')
diff --git a/config.yml b/config.yml
new file mode 100644
index 000000000000..9c7c938b3ea7
--- /dev/null
+++ b/config.yml
@@ -0,0 +1,37 @@
+# listen: Addr and port to listen (required)
+# If it has "SERVER_STARTER:" prefix, fd passed by https://github.com/lestrrat/go-server-starter will be used
+# e.g.
+# 127.0.0.1:8080
+# SERVER_STARTER:0.0.0.0:8080
+# SERVER_STARTER:/path/to/socket
+listen: "0.0.0.0:9099"
+
+# enable TLS (optional)
+#tls:
+# certfile: "/path/to/cert.crt"
+# keyfile: "/path/to/keyfile.key"
+
+## access_log (optional)
+#access_log:
+# format: "ltsv"
+# path: "./access.log" # optional (default: os.Stdout)
+# fields: ["time", "time_nsec", "status", "size", "reqtime_nsec", "backend", "path", "query", "method"]
+#
+## error_log (optional)
+#error_log:
+# path: "./error.log" # default: os.Stderr
+
+# exporters: The path of exporter_proxy and the URL of the destination exporter
+exporters:
+ node_exporter:
+ path: "/node_exporter/metrics"
+ url: "http://127.0.0.1:9100/metrics"
+ #mysqld_exporter:
+ # path: "/mysqld_exporter/metrics"
+ # url: "http://127.0.0.1:9104/metrics"
+
+
+# shutdown_timeout: timeout for shutting down HTTP server (optional)
+# On SIGTERM, exporter_proxy will try to shut down the server gracefully.
+# If shutdown_timeout is over, the server will be shutted down forcibly.
+shutdown_timeout: 10s
diff --git a/prometheus-exporter-proxy.service b/prometheus-exporter-proxy.service
new file mode 100644
index 000000000000..d9b8c541d1ea
--- /dev/null
+++ b/prometheus-exporter-proxy.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Prometheus Exporter Proxy
+After=network.target
+
+[Service]
+Type=simple
+User=nobody
+Group=nogroup
+Restart=on-failure
+ExecStart=/usr/bin/prometheus-exporter-proxy -config /etc/prometheus-exporter-proxy/config.yml
+
+[Install]
+WantedBy=multi-user.target
+