[arch-commits] Commit in (6 files)

Jelle van der Waa jelle at archlinux.org
Tue Jul 14 19:06:20 UTC 2020


    Date: Tuesday, July 14, 2020 @ 19:06:20
  Author: jelle
Revision: 391916

Addition of postgresql exporter for devops

Added:
  prometheus-postgresql-exporter/
  prometheus-postgresql-exporter/repos/
  prometheus-postgresql-exporter/trunk/
  prometheus-postgresql-exporter/trunk/PKGBUILD
  prometheus-postgresql-exporter/trunk/prometheus-postgresql-exporter.conf
  prometheus-postgresql-exporter/trunk/prometheus-postgresql-exporter.service

----------------------------------------+
 PKGBUILD                               |   42 +++++++++++++++++++++++++++++++
 prometheus-postgresql-exporter.conf    |    2 +
 prometheus-postgresql-exporter.service |   14 ++++++++++
 3 files changed, 58 insertions(+)

Added: prometheus-postgresql-exporter/trunk/PKGBUILD
===================================================================
--- prometheus-postgresql-exporter/trunk/PKGBUILD	                        (rev 0)
+++ prometheus-postgresql-exporter/trunk/PKGBUILD	2020-07-14 19:06:20 UTC (rev 391916)
@@ -0,0 +1,42 @@
+# Maintainer: Jelle van der Waa <jelle at archlinux.org>
+# Contributor: Nils Czernia <nils at czserver.de>
+
+pkgname=prometheus-postgresql-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=("https://github.com/wrouesnel/postgres_exporter/archive/v${pkgver}.tar.gz"
+        "prometheus-postgresql-exporter.service")
+sha256sums=('27877c9b3aa751c7c1265f39986218f6a2c2b66a126cf348c6cc2f20f5201b02'
+            'cda225c236df0e2a6d71c17a5390a92ed5cc7f71b8ca5843590c59fa02cdb135')
+
+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 run mage.go binary
+}
+
+check() {
+    export GOPATH="${srcdir}/gopath"
+    cd "${GOPATH}/src/github.com/wrouesnel/postgres_exporter"
+    go run mage.go test
+}
+
+package() {
+    install -Dm755 prometheus-postgresql-exporter.service "${pkgdir}/usr/lib/systemd/system/prometheus-postgresql-exporter.service"
+    install -Dm755 prometheus-postgresql-exporter.conf "${pkgdir}/etc/conf.d/prometheus-postgresql-exporter"
+
+    install -Dm755 "postgres_exporter-${pkgver}/postgres_exporter" "${pkgdir}/usr/bin/prometheus-postgresql-exporter"
+}

Added: prometheus-postgresql-exporter/trunk/prometheus-postgresql-exporter.conf
===================================================================
--- prometheus-postgresql-exporter/trunk/prometheus-postgresql-exporter.conf	                        (rev 0)
+++ prometheus-postgresql-exporter/trunk/prometheus-postgresql-exporter.conf	2020-07-14 19:06:20 UTC (rev 391916)
@@ -0,0 +1,2 @@
+DATA_SOURCE_NAME=""
+POSTGRESQL_EXPORTER_ARGS=""

Added: prometheus-postgresql-exporter/trunk/prometheus-postgresql-exporter.service
===================================================================
--- prometheus-postgresql-exporter/trunk/prometheus-postgresql-exporter.service	                        (rev 0)
+++ prometheus-postgresql-exporter/trunk/prometheus-postgresql-exporter.service	2020-07-14 19:06:20 UTC (rev 391916)
@@ -0,0 +1,14 @@
+[Unit]
+Description=Prometheus exporter for PostgreSQL
+After=network.target
+
+[Service]
+EnvironmentFile=-/etc/conf.d/prometheus-postgresql-exporter
+ExecStart=/usr/bin/prometheus-postgresql-exporter $POSTGRESQL_EXPORTER_ARGS
+Restart=on-failure
+
+
+PrivateDevices=true
+
+[Install]
+WantedBy=multi-user.target


More information about the arch-commits mailing list