-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net-misc/loki-promtail-bin add ebuild
- Loading branch information
1 parent
dad9e0b
commit 4de2c97
Showing
4 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DIST loki-promtail-bin-2.9.5.zip 26837462 BLAKE2B 56ea6438ca32a68a004961dba6d43b0340adc9cf9cdd4287d40024ccbda320bd19b9fc75764e7bcc5c89bd3348c51000b9b7b3691b7757e1c6062d0d7b61197c SHA512 652fa8aef13b5c58ed27e213557eb161a0fce607558ed79f5a6cf4adcfbb4cc9b49d9b2d58afc9b18100eebe5ba0d957dcc0ef26a9205dc71f2ec24800110f7c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/sbin/openrc-run | ||
# Copyright 2024 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
name="Loki Promtail" | ||
description="Promtail is a logs agent" | ||
command="/opt/bin/promtail" | ||
command_args="-config.file /etc/promtail.yml" | ||
command_background="true" | ||
pidfile="/var/run/${RC_SVCNAME}.pid" | ||
output_logger="logger -p daemon.info -t ${SVCNAME}" | ||
error_logger="logger -p daemon.error -t ${SVCNAME}" | ||
|
||
depend() { | ||
after net | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
server: | ||
http_listen_port: 9080 | ||
grpc_listen_port: 0 | ||
|
||
positions: | ||
filename: /tmp/positions.yaml | ||
|
||
clients: | ||
- url: 'http://localhost:3100/loki/api/v1/push' | ||
|
||
scrape_configs: | ||
- job_name: system | ||
static_configs: | ||
- targets: | ||
- localhost | ||
labels: | ||
job: varlogs | ||
__path__: /var/log/*log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright 2024 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
DESCRIPTION="Promtail is an agent which ships the contents of local logs to a Loki instance." | ||
HOMEPAGE="https://grafana.com/loki" | ||
SRC_URI="https://github.com/grafana/loki/releases/download/v${PV}/promtail-linux-amd64.zip -> ${P}.zip" | ||
|
||
S="${WORKDIR}" | ||
|
||
LICENSE="Apache-2.0" | ||
SLOT="0" | ||
KEYWORDS="~amd64" | ||
|
||
DEPEND=" | ||
app-arch/zip | ||
>=dev-lang/go-1.13:* | ||
" | ||
|
||
QA_PREBUILT="/opt/bin/promtail" | ||
QA_PRESTRIPPED="/opt/bin/promtail" | ||
|
||
RESTRICT="mirror strip" | ||
|
||
src_install() { | ||
newinitd "${FILESDIR}/promtail.initd" "promtail" | ||
dodoc *.md | ||
into /opt | ||
newbin promtail-linux-amd64 promtail | ||
insinto /etc | ||
doins "${FILESDIR}/promtail.yml" | ||
} | ||
|
||
pkg_postinst() { | ||
einfo | ||
einfo "Please make sure to modify /etc/promtail.yml before starting Promtail!" | ||
einfo | ||
} |