summaryrefslogtreecommitdiff
path: root/www-apps/trickster
diff options
context:
space:
mode:
Diffstat (limited to 'www-apps/trickster')
-rw-r--r--www-apps/trickster/Manifest6
-rw-r--r--www-apps/trickster/files/trickster.conf113
-rw-r--r--www-apps/trickster/files/trickster.initd25
-rw-r--r--www-apps/trickster/metadata.xml8
-rw-r--r--www-apps/trickster/trickster-0.1.9.ebuild47
5 files changed, 199 insertions, 0 deletions
diff --git a/www-apps/trickster/Manifest b/www-apps/trickster/Manifest
new file mode 100644
index 000000000000..d6d371d197d8
--- /dev/null
+++ b/www-apps/trickster/Manifest
@@ -0,0 +1,6 @@
+AUX trickster.conf 4759 BLAKE2B 223e0061992a9d3c0aad85d344cac0af00eb19e527a82e974840fdd5bc8cd7971083727697e038e7be7e9783bebd87ecf32ad4aecf2ef890cb53afd350982b88 SHA512 31975d8f20d5000b9400cda03469f6becb26e20f24c0213e80356b5e92b46c47efe2e820b1c448c6bc83b23de5c34442f13be8b9c66cfc169f99c85e5a7b6abc
+AUX trickster.initd 495 BLAKE2B 3ae2f752269665ce0a855a3b937625db4c7d3d077ecc59bb8a9acff4e78d38531fd392ec3cb1a05ab204f83ac50e25d1aa27344dac405eb37dd0a71c732a463c SHA512 2c7fade0e6e91ac10e1c9a9ab312e2fb794f5fd86332b780a2d5b076ca00e460dac11cc3486bf43dceda7be1baa29b57a298fe257229012cf48b9f92861c7c8f
+DIST trickster-0.1.9-vendor.tar.gz 1748976 BLAKE2B 77ad4a91a889a8241399fe6b4199d25c0ba52e818fbe1df8186dadea0f69c1d04f9c268fc376820592465ed36104a6195ce9a9985f8a9c02636ee1b8f80114b7 SHA512 6427cb3417ae7d62e5e144cb5a1962f2175ab063c2267abd838560db00acc4c161666df4ea2065a02172b50240f17a6ad09d76973e59d9bea91ecf4a9327466f
+DIST trickster-0.1.9.tar.gz 1739869 BLAKE2B dc50d12acfe27f68054bbafdeada0bd1847ebb1e03847f9173c7e9b772218ce2e7ceffe25db282912f88c005c0d590e3effece6483bdd80830438a8d114f859f SHA512 82fa837d2b18143a65e22a06d2821d7a1da298fb3e9389854f8e6ad4de68f35d40d6aec2d23cca877032227d12818063953244a01b42f09bd724677d1080e84f
+EBUILD trickster-0.1.9.ebuild 972 BLAKE2B 521c084c46620e73387650a325656669e8d8f4dcf03267d2f527983a8cd2e881b484b334860b9b98a6b9e735d2e39a7d3d44fd3efde3c560155bb801a1e8c345 SHA512 62d81e7c88370c30c9acea89452188244884cf9dddb24434fb4864edc81ce43075f94ee047449f8601fb5fc7adf7fb66aaa6d1fcf7ea1ec0868547ec83ca29db
+MISC metadata.xml 248 BLAKE2B 5d9c3678c604aac0f24c5d5015e28f02b9ce83bb6a179755a44adeb3d69e4dd50be4acc30a6317649f5be23bcf13ac210bbe4712aa403e9c4cf2de351b39c941 SHA512 dc5b06a888be6367909895d5891a08189f4657bcee602e5ff0021be2ad3677e58ec7387ff244625be66a142138666e7eac790d2a7b1e298f0ad644725b5e57e0
diff --git a/www-apps/trickster/files/trickster.conf b/www-apps/trickster/files/trickster.conf
new file mode 100644
index 000000000000..9fb255e19c5b
--- /dev/null
+++ b/www-apps/trickster/files/trickster.conf
@@ -0,0 +1,113 @@
+[main]
+# instance_id allows you to run multiple trickster processes on the same host and log to separate files
+# Useful for baremetal, not so much for elastic deployments, so only uncomment if you really need it
+#instance_id = 1
+
+# Configuration options for the Proxy Server
+[proxy_server]
+# listen_port defines the port on which Trickster's Proxy server listens.
+# since this is a proxy for Prometheus, we use 9090 by default, just like Prometheus does
+# listen_port = 9090
+# listen_address defines the ip on which Trickster's Proxy server listens.
+# empty by default, listening on all interfaces
+# listen_address =
+
+[cache]
+# cache_type defines what kind of cache Trickster uses
+# options are 'boltdb', 'filesystem', 'memory', and 'redis'.
+# The default is 'memory'.
+cache_type = 'memory'
+
+# record_ttl_secs defines the relative expiration of cached queries. default is 6 hours (21600 seconds)
+# record_ttl_secs = 21600
+
+# reap_sleep_ms defines how long the cache reaper waits between reap cycles. Default is 1000 (1s)
+# reap_sleep_ms = 1000
+
+# compression determines whether the cache should be compressed. default is true
+# compression = true
+
+ ### Configuration options when using a Redis Cache
+ # [cache.redis]
+ # protocol defines the protocol for connecting to redis ('unix' or 'tcp') 'tcp' is default
+ # protocol = 'tcp'
+ # endpoint defines the fqdn+port or path to a unix socket file for connecting to redis
+ # default is 'redis:6379'
+ # endpoint = 'redis:6379'
+
+ ### Configuration options when using a Filesystem Cache
+ # [cache.filesystem]
+ # cache_path defines the directory location under which the Trickster cache will be maintained
+ # default is '/tmp/trickster'
+ # cache_path = '/tmp/trickster'
+
+ # Configuration options when using a BoltDb Cache
+ #[cache.boltdb]
+
+ # filename defines the file where the Trickster cache will be maintained
+ # default is 'trickster.db'
+ # filename = 'trickster.db'
+
+ # bucket defines the name of the BotlDb bucket (similar to a namespace) under which our key value store lives
+ # default is 'trickster'
+ # bucket = 'trickster'
+
+# Configuration options for mapping Origin(s)
+[origins]
+ ### The default origin
+ [origins.default]
+
+ # origin_url defines the URL of the origin. Default is http://prometheus:9090
+ origin_url = 'http://prometheus:9090'
+
+ # timeout_secs defines how many seconds Trickster will wait before aborting and upstream http request. Default: 180s
+ # timeout_secs = 180
+
+ # api path defines the path of the Prometheus API (usually '/api/v1')
+ api_path = '/api/v1'
+
+ # ignore_no_cache_header disables a client's ability to send a no-cache to refresh a cached query. Default is false
+ # ignore_no_cache_header = false
+
+ # max_value_age_secs defines the maximum age of specific datapoints in seconds. Default is 86400 (24 hours)
+ max_value_age_secs = 86400
+
+ # fast_forward_disable, when set to true, will turn off the 'fast forward' feature for any requests proxied to this origin
+ # fast_forward_disable = false
+
+ # For multi-origin support, origins are named, and the name is the second word of the configuration section name.
+ # In this example, an origin is named "foo". Clients can indicate this origin in their path (http://trickster.example.com:9090/foo/query_range?.....)
+ # there are other ways for clients to indicate which origin to use in a multi-origin setup. See the documentation for more information
+
+ # [origins.foo]
+ # origin_url = 'http://prometheus-foo:9090'
+ # api_path = '/api/v1'
+ # default_step = 300
+ # ignore_no_cache_header = false
+ # max_value_age_secs = 86400
+ # timeout_secs = 180
+
+# Configuration Options for Metrics Instrumentation
+[metrics]
+# listen_port defines the port that Trickster's metrics server listens on at /metrics
+listen_port = 8082
+# listen_address defines the ip that Trickster's metrics server listens on at /metrics
+# empty by default, listening on all interfaces
+# listen_address =
+
+# Configruation Options for Profiler
+[profiler]
+# enabled indicates whether to start the profiler server when Trickster starts up. Default: false
+# enabled = false
+# listen_port defines the port that Trickster's profiler server listens on at /debug/pprof. Default: 6060
+# listen_port = 6060
+
+# Configuration Options for Logging Instrumentation
+[logging]
+# log_level defines the verbosity of the logger. Possible values are 'debug', 'info', 'warn', 'error'
+# default is info
+log_level = 'info'
+
+# log_file defines the file location to store logs. These will be auto-rolled and maintained for you.
+# not specifying a log_file (this is the default behavior) will print logs to STDOUT
+log_file = '/var/log/trickster/trickster.log'
diff --git a/www-apps/trickster/files/trickster.initd b/www-apps/trickster/files/trickster.initd
new file mode 100644
index 000000000000..bdee1f57e2e6
--- /dev/null
+++ b/www-apps/trickster/files/trickster.initd
@@ -0,0 +1,25 @@
+#!/sbin/openrc-run
+
+description="Dashboard Accelerator for Prometheus"
+command=/usr/bin/trickster
+command_background=yes
+command_user=${user:-trickster}:${group:-trickster}
+extra_started_commands=reload
+pidfile=/var/run/${RC_SVCNAME}.pid
+
+depend() {
+ after net
+}
+
+reload() {
+ ebegin "Reloading ${RC_SVCNAME}"
+ case "${supervisor}" in
+ supervise-daemon)
+ supervise-daemon --signal HUP --pidfile "${pidfile}"
+ ;;
+ *)
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ ;;
+ esac
+ eend $?
+}
diff --git a/www-apps/trickster/metadata.xml b/www-apps/trickster/metadata.xml
new file mode 100644
index 000000000000..c36c37139fad
--- /dev/null
+++ b/www-apps/trickster/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>williamh@gentoo.org</email>
+ <name>William Hubbs</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/www-apps/trickster/trickster-0.1.9.ebuild b/www-apps/trickster/trickster-0.1.9.ebuild
new file mode 100644
index 000000000000..d147b62d604c
--- /dev/null
+++ b/www-apps/trickster/trickster-0.1.9.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit user systemd
+
+DESCRIPTION="Dashboard Accelerator for Prometheus"
+HOMEPAGE="https://github.com/Comcast/trickster"
+VENDOR_URI="https://dev.gentoo.org/~williamh/dist/${P}-vendor.tar.gz"
+SRC_URI="https://github.com/Comcast/trickster/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ ${VENDOR_URI}"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+
+DEPEND="dev-lang/go:="
+
+RESTRICT="strip"
+
+pkg_setup() {
+ enewgroup ${PN}
+ enewuser ${PN} -1 -1 -1 ${PN}
+}
+
+src_prepare() {
+ default
+ mv ../vendor .
+}
+
+src_compile() {
+ set -- env GOCACHE="${T}"/go-cache go build -a -mod vendor -v
+ echo $@
+ "$@" || die "build failed"
+}
+
+src_install() {
+ dobin ${PN}
+dodoc -r conf docs/*
+ systemd_dounit conf/trickster.service
+ keepdir /var/log/${PN}
+ fowners ${PN}:${PN} /var/log/${PN}
+ insinto /etc/trickster
+ doins "${FILESDIR}"/${PN}.conf
+ newinitd "${FILESDIR}"/${PN}.initd ${PN}
+}