diff options
author | George Rawlinson | 2020-11-18 13:58:48 +1300 |
---|---|---|
committer | George Rawlinson | 2020-11-18 13:58:48 +1300 |
commit | e49f88b1801f365ae1c44e0d9967c23b0b8cd38b (patch) | |
tree | c5752e529090212e1d458c69c01a1ce849e02afc | |
parent | 51faef59c9caced5401f1d8970c24f7dee2c0f7b (diff) | |
download | aur-e49f88b1801f365ae1c44e0d9967c23b0b8cd38b.tar.gz |
upgpkg: promscale 0.1.2-2
add systemd integration via service & sysusers files
-rw-r--r-- | PKGBUILD | 24 | ||||
-rw-r--r-- | promscale.conf | 55 | ||||
-rw-r--r-- | promscale.service | 19 | ||||
-rw-r--r-- | promscale.sysusers.conf | 1 |
4 files changed, 95 insertions, 4 deletions
@@ -2,17 +2,25 @@ pkgname=promscale pkgver=0.1.2 -pkgrel=1 +pkgrel=2 pkgdesc="An open source analytical platform for Prometheus metrics" arch=('x86_64') url="https://github.com/timescale/promscale" license=('Apache') makedepends=(go) checkdepends=() -optdepends=(timescaledb prometheus) +optdepends=(timescaledb + prometheus + promscale_extension) changelog= -source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz") -b2sums=('761e00de8829fae2a6b5f2b9c6b7e1db0f3b4391076af4df2faebb02186707ed25c75ef52020b6e43eebfac414db2ee7c26bcfd535de748697ff56e7639f0408') +source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz" + "$pkgname.service" + "$pkgname.sysusers.conf" + "$pkgname.conf") +b2sums=('761e00de8829fae2a6b5f2b9c6b7e1db0f3b4391076af4df2faebb02186707ed25c75ef52020b6e43eebfac414db2ee7c26bcfd535de748697ff56e7639f0408' + '2aefdad3110543a53afc43ccdd3dbaf23cf6a2eaf4d3225ac0164c0d6ce0d057254ba67b2809d83112fbac5639c483252302d3325edc2036a417a19687629afd' + '2fae9c07cd255528a1c87062650956b857caa8a3c656b59e85d740f527433f510a8fe18025e03480d9145673e6dd03867d60ead5a48044353262105a173cbbfd' + '44b673203d0d2fa3af9f7e9bce8c6aefd61f14cde9dff2a261132ab99f2433940f37a9b70c49a234689a4277b7240ec411a38b9708001f49114a960d0770d7ed') prepare() { cd "$pkgname-$pkgver" @@ -30,5 +38,13 @@ build() { } package() { + # systemd integration + install -Dm644 -t "$pkgdir/usr/lib/systemd/system" "$srcdir/$pkgname.service" + install -Dm644 "$srcdir/$pkgname.sysusers.conf" "$pkgdir/usr/lib/sysusers.d/$pkgname.conf" + + # environment variable file + install -Dm644 "$srcdir/$pkgname.conf" "$pkgdir/etc/conf.d/$pkgname" + + # binary install -Dm755 -t "$pkgdir/usr/bin" "$pkgname-$pkgver/cmd/$pkgname/$pkgname" } diff --git a/promscale.conf b/promscale.conf new file mode 100644 index 000000000000..9e67078107a4 --- /dev/null +++ b/promscale.conf @@ -0,0 +1,55 @@ +# Specify additional arguments to pass to promscale on startup +PROMSCALE_ARGS="" + +# Available arguments and environment variables: +# +# -async-acks +# Ack before data is written to DB [TS_PROM_ASYNC_ACKS] +# -db-connect-retries int +# How many times to retry connecting to the database [TS_PROM_DB_CONNECT_RETRIES] +# -db-connections-max int +# maximum connections that can be open at once, defaults to 80% of the max the DB can handle [TS_PROM_DB_CONNECTIONS_MAX] (default -1) +# -db-host string +# The TimescaleDB host [TS_PROM_DB_HOST] (default "localhost") +# -db-name string +# The TimescaleDB database [TS_PROM_DB_NAME] (default "timescale") +# -db-password string +# The TimescaleDB password [TS_PROM_DB_PASSWORD] +# -db-port int +# The TimescaleDB port [TS_PROM_DB_PORT] (default 5432) +# -db-ssl-mode string +# The TimescaleDB connection ssl mode [TS_PROM_DB_SSL_MODE] (default "require") +# -db-user string +# The TimescaleDB user [TS_PROM_DB_USER] (default "postgres") +# -db-writer-connection-concurrency int +# maximum number of database connections per go process writing to the database [TS_PROM_DB_WRITER_CONNECTION_CONCURRENCY] (default 4) +# -install-timescaledb +# Install or update the TimescaleDB extension [TS_PROM_INSTALL_TIMESCALEDB] (default true) +# -labels-cache-size uint +# maximum number of labels to cache [TS_PROM_LABELS_CACHE_SIZE] (default 10000) +# -leader-election-pg-advisory-lock-id int +# Unique advisory lock id per adapter high-availability group. Set it if you want to use leader election implementation based on PostgreSQL advisory lock. [TS_PROM_LEADER_ELECTION_PG_ADVISORY_LOCK_ID] +# -leader-election-pg-advisory-lock-prometheus-timeout slack +# Adapter will resign if there are no requests from Prometheus within a given timeout (0 means no timeout). Note: make sure that only one Prometheus instance talks to the adapter. Timeout value should be co-related with Prometheus scrape interval but add enough slack to prevent random flips. [TS_PROM_LEADER_ELECTION_PG_ADVISORY_LOCK_PROMETHEUS_TIMEOUT] (default -1ns) +# -log-format string +# The log format to use [ "logfmt", "json" ]. [TS_PROM_LOG_FORMAT] (default "logfmt") +# -log-level string +# The log level to use [ "error", "warn", "info", "debug" ]. [TS_PROM_LOG_LEVEL] (default "debug") +# -metrics-cache-size uint +# maximum number of metric names to cache [TS_PROM_METRICS_CACHE_SIZE] (default 10000) +# -migrate string +# Update the Prometheus SQL to the latest version. Valid options are: [true, false, only] [TS_PROM_MIGRATE] (default "true") +# -read-only +# Read-only mode. Don't write to database. Useful when pointing adapter to read replica [TS_PROM_READ_ONLY] +# -scheduled-election-interval duration +# Interval at which scheduled election runs. This is used to select a leader and confirm that we still holding the advisory lock. [TS_PROM_SCHEDULED_ELECTION_INTERVAL] (default 5s) +# -tput-report int +# interval in seconds at which throughput should be reported [TS_PROM_TPUT_REPORT] +# -use-schema-version-lease +# Prevent race conditions during migration [TS_PROM_USE_SCHEMA_VERSION_LEASE] (default true) +# -web-cors-origin string +# Regex for CORS origin. It is fully anchored. Example: 'https?://(domain1|domain2)\.com' [TS_PROM_WEB_CORS_ORIGIN] (default ".*") +# -web-listen-address string +# Address to listen on for web endpoints. [TS_PROM_WEB_LISTEN_ADDRESS] (default ":9201") +# -web-telemetry-path string +# Address to listen on for web endpoints. [TS_PROM_WEB_TELEMETRY_PATH] (default "/metrics") diff --git a/promscale.service b/promscale.service new file mode 100644 index 000000000000..bdafd1e3c828 --- /dev/null +++ b/promscale.service @@ -0,0 +1,19 @@ +[Unit] +Description=Promscale service +Documentation=https://github.com/timescale/promscale +Requires=network-online.target +After=network-online.target + +[Service] +User=promscale +Group=promscale +Restart=on-failure +EnvironmentFile=-/etc/conf.d/promscale +ExecStart=/usr/bin/promscale $PROMSCALE_ARGS +ExecReload=/bin/kill -HUP $MAINPID +NoNewPrivileges=true +ProtectSystem=true + +[Install] +WantedBy=multi-user.target + diff --git a/promscale.sysusers.conf b/promscale.sysusers.conf new file mode 100644 index 000000000000..15b235304adc --- /dev/null +++ b/promscale.sysusers.conf @@ -0,0 +1 @@ +u promscale - "User for promscale service" |