Date: Thursday, July 16, 2020 @ 19:58:50
  Author: jelle
Revision: 391975

Prometheus exporter for infrastructure

Added:
  prometheus-postgres-exporter/trunk/PKGBUILD
  prometheus-postgres-exporter/trunk/prometheus-postgres-exporter.conf
  prometheus-postgres-exporter/trunk/prometheus-postgres-exporter.service

--------------------------------------+
 PKGBUILD                             |   48 +++++++++++++++++++++++++++++++++
 prometheus-postgres-exporter.conf    |    2 +
 prometheus-postgres-exporter.service |   26 +++++++++++++++++
 3 files changed, 76 insertions(+)

Added: PKGBUILD
===================================================================
--- PKGBUILD                            (rev 0)
+++ PKGBUILD    2020-07-16 19:58:50 UTC (rev 391975)
@@ -0,0 +1,48 @@
+# Maintainer: Jelle van der Waa <je...@archlinux.org>
+# Contributor: Nils Czernia <n...@czserver.de>
+
+pkgname=prometheus-postgres-exporter
+pkgver=0.8.0
+pkgrel=2
+pkgdesc="Prometheus exporter for PostrgreSQL"
+arch=('x86_64')
+url="https://github.com/wrouesnel/postgres_exporter";
+license=('Apache')
+makedepends=('git' 'go')
+source=(${pkgname}-${pkgver}.tar.gz::https://github.com/wrouesnel/postgres_exporter/archive/v${pkgver}.tar.gz
+        "prometheus-postgres-exporter.service"
+        "prometheus-postgres-exporter.conf")
+sha256sums=('27877c9b3aa751c7c1265f39986218f6a2c2b66a126cf348c6cc2f20f5201b02'
+            '5361f16ddf02d0c43665884674e9a3049cf6da8ac3a19eb7dba154354853eda6'
+            'd132e8140c147f3a26fdff648c4e4e59b80225a7ee10195b9e460e224316e556')
+
+prepare() {
+  cd "${srcdir}/postgres_exporter-${pkgver}"
+
+  export GOPATH="${srcdir}/gopath"
+  mkdir -p "${GOPATH}/src/github.com/wrouesnel"
+  ln -snf "${srcdir}/postgres_exporter-${pkgver}" 
"${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
+}
+
+build() {
+  export GOPATH="${srcdir}/gopath"
+  cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
+  go build \
+    -trimpath \
+    -buildmode=pie \
+    -ldflags "-extldflags \"${LDFLAGS}\"" \
+  ./cmd/postgres_exporter
+}
+
+check() {
+  export GOPATH="${srcdir}/gopath"
+  cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
+  go test ./...
+}
+
+package() {
+  install -Dm755 ${srcdir}/prometheus-postgres-exporter.service 
"${pkgdir}/usr/lib/systemd/system/prometheus-postgres-exporter.service"
+  install -Dm600 ${srcdir}/prometheus-postgres-exporter.conf 
"${pkgdir}/etc/conf.d/prometheus-postgres-exporter"
+
+  install -Dm755 "postgres_exporter-${pkgver}/postgres_exporter" 
"${pkgdir}/usr/bin/prometheus-postgres-exporter"
+}

Added: prometheus-postgres-exporter.conf
===================================================================
--- prometheus-postgres-exporter.conf                           (rev 0)
+++ prometheus-postgres-exporter.conf   2020-07-16 19:58:50 UTC (rev 391975)
@@ -0,0 +1,2 @@
+DATA_SOURCE_NAME=""
+POSTGRESQL_EXPORTER_ARGS=""

Added: prometheus-postgres-exporter.service
===================================================================
--- prometheus-postgres-exporter.service                                (rev 0)
+++ prometheus-postgres-exporter.service        2020-07-16 19:58:50 UTC (rev 
391975)
@@ -0,0 +1,26 @@
+[Unit]
+Description=Prometheus exporter for PostgreSQL
+After=network.target
+
+[Service]
+EnvironmentFile=-/etc/conf.d/prometheus-postgres-exporter
+ExecStart=/usr/bin/prometheus-postgres-exporter $POSTGRESQL_EXPORTER_ARGS
+Restart=on-failure
+
+DynamicUser=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+LockPersonality=true
+ProtectHostname=true
+ProtectHome=true
+ProtectClock=true
+ProtectControlGroups=true
+ProtectKernelLogs=true
+PrivateDevices=true
+PrivateUsers=true
+RestrictRealtime=true
+CapabilityBoundingSet=
+MemoryDenyWriteExecute=true
+
+[Install]
+WantedBy=multi-user.target

Reply via email to