Add 'prometheus-postgresql-exporter/' from commit '69aa9255bbec35da7cca87fc940eef91f64dfdf4'

git-subtree-dir: prometheus-postgresql-exporter
git-subtree-mainline: 72e058bcd0
git-subtree-split: 69aa9255bb
This commit is contained in:
Manuel 2022-10-18 00:00:02 +02:00
commit c91488a4fe
4 changed files with 94 additions and 0 deletions

View file

@ -0,0 +1,19 @@
pkgbase = prometheus-postgresql-exporter
pkgdesc = Prometheus exporter for PostgreSQL
pkgver = 0.11.1
pkgrel = 1
url = https://github.com/prometheus-community/postgres_exporter
arch = x86_64
license = Apache
makedepends = git
makedepends = go
makedepends = make
backup = etc/conf.d/prometheus-postgresql-exporter
source = https://github.com/prometheus-community/postgres_exporter/archive/v0.11.1.tar.gz
source = prometheus-postgresql-exporter.service
source = prometheus-postgresql-exporter.conf
sha256sums = 48e38e5cc8f093f93a84b1536c2ae7dc480760f9c443ae654a9f1f83d289a7bc
sha256sums = 0d86e650d88c8d4a8bc5b26faecb75023e069eaf29582135bcb0202e4a69a9b9
sha256sums = 5436ad34fbcd6faab69da8675631f3eb5b89d964682eb23164bf4bb816ad1897
pkgname = prometheus-postgresql-exporter

View file

@ -0,0 +1,47 @@
# Maintainer: Manuel Hüsers <aur@huesers.de>
# Contributor: Nils Czernia <nils@czserver.de>
pkgname=prometheus-postgresql-exporter
pkgver=0.11.1
pkgrel=1
pkgdesc="Prometheus exporter for PostgreSQL"
arch=('x86_64')
url="https://github.com/prometheus-community/postgres_exporter"
license=('Apache')
makedepends=('git' 'go' 'make')
backup=('etc/conf.d/prometheus-postgresql-exporter')
source=("https://github.com/prometheus-community/postgres_exporter/archive/v${pkgver}.tar.gz"
"prometheus-postgresql-exporter.service"
"prometheus-postgresql-exporter.conf")
sha256sums=('48e38e5cc8f093f93a84b1536c2ae7dc480760f9c443ae654a9f1f83d289a7bc'
'0d86e650d88c8d4a8bc5b26faecb75023e069eaf29582135bcb0202e4a69a9b9'
'5436ad34fbcd6faab69da8675631f3eb5b89d964682eb23164bf4bb816ad1897')
prepare() {
cd "postgres_exporter-${pkgver}"
export GOPATH="${srcdir}/gopath"
mkdir -p "${GOPATH}/src/github.com/prometheus-community"
ln -snf "${srcdir}/postgres_exporter-${pkgver}" "${GOPATH}/src/github.com/prometheus-community/postgres_exporter"
}
build() {
export CGO_CPPFLAGS="${CPPFLAGS}"
export CGO_CFLAGS="${CFLAGS}"
export CGO_CXXFLAGS="${CXXFLAGS}"
export CGO_LDFLAGS="${LDFLAGS}"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
export GOPATH="${srcdir}/gopath"
cd "${GOPATH}/src/github.com/prometheus-community/postgres_exporter"
make build
}
package() {
install -Dm644 "prometheus-postgresql-exporter.service" \
"${pkgdir}/usr/lib/systemd/system/prometheus-postgresql-exporter.service"
install -Dm644 "prometheus-postgresql-exporter.conf" \
"${pkgdir}/etc/conf.d/prometheus-postgresql-exporter"
cd "postgres_exporter-${pkgver}"
install -Dm755 "postgres_exporter" "${pkgdir}/usr/bin/prometheus_postgresql_exporter"
}

View file

@ -0,0 +1,2 @@
DATA_SOURCE_NAME=""
POSTGRES_EXPORTER_ARGS=""

View file

@ -0,0 +1,26 @@
[Unit]
Description=Prometheus exporter for PostgreSQL
After=network.target
[Service]
EnvironmentFile=-/etc/conf.d/prometheus-postgresql-exporter
ExecStart=/usr/bin/prometheus_postgresql_exporter $POSTGRES_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