[arch-commits] Commit in (6 files)
Jelle van der Waa
jelle at archlinux.org
Mon Jul 13 20:36:07 UTC 2020
Date: Monday, July 13, 2020 @ 20:36:07
Author: jelle
Revision: 391882
Add prometheus-mysqld-exporter for devops
Added:
prometheus-mysqld-exporter/
prometheus-mysqld-exporter/repos/
prometheus-mysqld-exporter/trunk/
prometheus-mysqld-exporter/trunk/PKGBUILD
prometheus-mysqld-exporter/trunk/prometheus-mysqld-exporter.conf
prometheus-mysqld-exporter/trunk/prometheus-mysqld-exporter.service
------------------------------------+
PKGBUILD | 46 +++++++++++++++++++++++++++++++++++
prometheus-mysqld-exporter.conf | 2 +
prometheus-mysqld-exporter.service | 24 ++++++++++++++++++
3 files changed, 72 insertions(+)
Added: prometheus-mysqld-exporter/trunk/PKGBUILD
===================================================================
--- prometheus-mysqld-exporter/trunk/PKGBUILD (rev 0)
+++ prometheus-mysqld-exporter/trunk/PKGBUILD 2020-07-13 20:36:07 UTC (rev 391882)
@@ -0,0 +1,46 @@
+# Maintainer: Jelle van der Waa <jelle at archlinux.org>
+# Contributor: Jakob Gahde <j5lx at fmail.co.uk>
+
+pkgname=prometheus-mysqld-exporter
+pkgver=0.12.1
+pkgrel=2
+pkgdesc="Prometheus exporter for MySQL server metrics"
+arch=('x86_64')
+url="https://github.com/prometheus/mysqld_exporter"
+license=('Apache')
+depends=('glibc')
+makedepends=('go')
+backup=('etc/conf.d/prometheus-mysqld-exporter')
+source=("mysql_exporter-${pkgver}.tar.gz::https://github.com/prometheus/mysqld_exporter/archive/v${pkgver}.tar.gz"
+ "prometheus-mysqld-exporter.service"
+ "prometheus-mysqld-exporter.conf")
+sha512sums=('a655a9ad4b5bc6e7840df68bee934d55485d3a04a7dc8186c8f9d224eb33b0e1d98de3db78a0c7d92f9b3d6ca06ead2d609cf2cfa99e584635f0339984e60629'
+ '845716ce251bc29d8059f113e7451030ac1fa592e9b8f4f6daa39d2326fe451f66cfa9f5fe8acc7ece6b875ed811ea4818df04d70269ecc76a560dfdfadd1fad'
+ 'c13a99a42e5a28e2be1287c337aa0f351dc8ffdbafb903e51a360d00aecf1d49d2b28b73e3741cdf681cb18c33546ae2088a8dab8bc4908b5c5ef008500b40fb')
+
+build() {
+ cd "mysqld_exporter-${pkgver}"
+
+ go build \
+ -trimpath \
+ -buildmode=pie \
+ -mod=readonly \
+ -modcacherw \
+ -ldflags "-extldflags ${LDFLAGS}
+ -X github.com/prometheus/common/version.Version=${pkgver} \
+ -X github.com/prometheus/common/version.Revision=${pkgver} \
+ -X github.com/prometheus/common/version.Branch=tarball \
+ -X github.com/prometheus/common/version.BuildUser=someone at builder \
+ -X github.com/prometheus/common/version.BuildDate=$(date -d@"${SOURCE_DATE_EPOCH}" +%Y%m%d-%T)" \
+ .
+}
+
+package() {
+ install -Dm644 "prometheus-mysqld-exporter.service" \
+ "${pkgdir}/usr/lib/systemd/system/prometheus-mysqld-exporter.service"
+ install -Dm644 "prometheus-mysqld-exporter.conf" \
+ "${pkgdir}/etc/conf.d/prometheus-mysqld-exporter"
+
+ cd "mysqld_exporter-${pkgver}"
+ install -Dm755 "mysqld_exporter" "${pkgdir}/usr/bin/prometheus-mysqld-exporter"
+}
Added: prometheus-mysqld-exporter/trunk/prometheus-mysqld-exporter.conf
===================================================================
--- prometheus-mysqld-exporter/trunk/prometheus-mysqld-exporter.conf (rev 0)
+++ prometheus-mysqld-exporter/trunk/prometheus-mysqld-exporter.conf 2020-07-13 20:36:07 UTC (rev 391882)
@@ -0,0 +1,2 @@
+DATA_SOURCE_NAME=""
+MYSQLD_EXPORTER_ARGS=""
Added: prometheus-mysqld-exporter/trunk/prometheus-mysqld-exporter.service
===================================================================
--- prometheus-mysqld-exporter/trunk/prometheus-mysqld-exporter.service (rev 0)
+++ prometheus-mysqld-exporter/trunk/prometheus-mysqld-exporter.service 2020-07-13 20:36:07 UTC (rev 391882)
@@ -0,0 +1,24 @@
+[Unit]
+Description=Prometheus exporter for MySQL server metrics
+After=network.target
+
+[Service]
+EnvironmentFile=-/etc/conf.d/prometheus-mysqld-exporter
+ExecStart=/usr/bin/prometheus-mysqld-exporter $MYSQLD_EXPORTER_ARGS
+Restart=on-failure
+
+DynamicUser=true
+ProtectKernelModules=true
+ProtectKernelTunables=true
+LockPersonality=true
+ProtectHostname=true
+ProtectHome=true
+ProtectControlGroups=true
+ProtectKernelLogs=true
+PrivateDevices=true
+RestrictRealtime=true
+CapabilityBoundingSet=
+MemoryDenyWriteExecute=true
+
+[Install]
+WantedBy=multi-user.target
More information about the arch-commits
mailing list