1 # Maintainer: Daurnimator <daurnimator@archlinux.org>
3 pkgname=('grafana-agent' 'grafana-agentctl' 'grafana-agent-crow')
6 pkgdesc='Grafana Agent is a telemetry collector for sending metrics, logs, and trace data to the opinionated Grafana observability stack'
7 url='https://github.com/grafana/agent'
11 makedepends=('go' 'systemd')
13 source=($pkgname-$pkgver.tar.gz::https://github.com/grafana/agent/archive/v$pkgver.tar.gz
14 grafana-agent.sysusers grafana-agent.service grafana-agent.tmpfiles)
15 sha512sums=('502af100047db6f5b3848711c1cf301b58a9dcd9a85dc967ded78c8ec889ffc6c4bf985ee9c1c9ab1f4a92f4f7a6756b215cd434a3d33ac77469530a738147e0'
16 '1e58f6273562fd6ddeae41bb6d223230ed301199af6bd2f85fa3d2c1e6352952c600cd4488ad769069519c42b6863be84aaa2c93c88f696e5a0bedbb93758d0e'
17 '3f8debbc4732009f54c063d70c2dce4846b81b829f495d25a431fef857077c83949d777f763de8c106fb8d1cf0bd7e874680db8387b4811704b1a303932fa090'
18 '3a4c4896b2454272b5a2d53ba5aa7009fa5b42a573fef521afb5d9712e53119539c4195d2b149d04d086c5fa197ccf7dc9bbdc407efb55514e3c92b994121fa8')
23 export GOPATH="${srcdir}"
30 export CGO_LDFLAGS="${LDFLAGS}"
31 export CGO_CFLAGS="${CFLAGS}"
32 export CGO_CPPFLAGS="${CPPFLAGS}"
33 export CGO_CXXFLAGS="${CXXFLAGS}"
34 export GOPATH="${srcdir}"
36 for path in cmd/grafana-agent cmd/grafana-agentctl tools/crow; do
42 -tags promtail_journal_enabled \
44 -X github.com/grafana/agent/pkg/build.Version=$pkgver
45 -X github.com/grafana/agent/pkg/build.BuildDate=$(date -u +'%Y-%m-%dT%H:%M:%SZ' --date=@${SOURCE_DATE_EPOCH})
48 -extldflags \"${LDFLAGS}\"" \
56 ./grafana-agent -version
57 ./grafana-agentctl --version
59 go test -v ./pkg/{agentctl,config,crow,logs,metrics,server,traces}/
62 package_grafana-agent() {
63 backup=('etc/grafana-agent.yaml')
67 install -Dm755 -t "$pkgdir/usr/bin" grafana-agent
68 install -Dm644 packaging/grafana-agent/grafana-agent.yaml "$pkgdir/etc/grafana-agent.yaml"
70 install -Dm644 "$srcdir/grafana-agent.sysusers" "$pkgdir/usr/lib/sysusers.d/grafana-agent.conf"
71 install -Dm644 "$srcdir/grafana-agent.tmpfiles" "$pkgdir/usr/lib/tmpfiles.d/grafana-agent.conf"
72 install -Dm644 "$srcdir/grafana-agent.service" "$pkgdir/usr/lib/systemd/system/grafana-agent.service"
75 package_grafana-agentctl() {
76 pkgdesc="provides utilities for interacting with Grafana Agent"
80 install -Dm755 -t "$pkgdir"/usr/bin grafana-agentctl
83 package_grafana-agent-crow() {
84 pkgdesc="A correctness checker tool that validates that scraped metrics are delivered to a remote_write endpoint."
88 install -Dm755 crow "$pkgdir"/usr/bin/grafana-agent-crow