generated from snapcrafters/snap-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
snapcraft.yaml
80 lines (76 loc) · 2.08 KB
/
snapcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: grafana-agent
version: '0.39.2'
summary: A telemetry collector for sending metrics, logs, and trace data
license: Apache-2.0
contact: simon.aronsson@canonical.com
issues: https://github.com/canonical/grafana-agent-snap/issues
source-code: https://github.com/canonical/grafana-agent-snap
website: https://grafana.com
description: "Grafana Agent is a telemetry collector for sending metrics, \nlogs, and trace data to the opinionated Grafana observability stack.\n"
base: core22
grade: stable
confinement: strict
compression: lzo
plugs:
etc-grafana-agent:
interface: system-files
read:
- /etc/grafana-agent.yaml
logs:
interface: content
target: $SNAP/shared-logs
proc-sys-kernel-random:
interface: system-files
read:
- /proc/sys/kernel/random/write_wakeup_threshold
- /proc/sys/kernel/random/read_wakeup_threshold
- /proc/sys/kernel/random/poolsize
- /proc/sys/kernel/random/urandom_min_reseed_secs
apps:
grafana-agent:
daemon: simple
command: agent-wrapper
install-mode: disable
restart-condition: on-failure
plugs:
- network-bind
- time-control
- hardware-observe
- mount-observe
- network-observe
- system-observe
- log-observe
- etc-grafana-agent
- proc-sys-kernel-random
architectures:
- build-on: amd64
- build-on: arm64
parts:
wrapper:
plugin: dump
source: ./snap/local
source-type: local
override-build: |
cp agent-wrapper $CRAFT_PART_INSTALL/
grafana-agent:
plugin: go
source: https://github.com/grafana/agent
source-type: git
source-tag: "v0.39.2"
build-snaps:
- go
build-packages:
- build-essential
- libsystemd-dev
- libbpfcc-dev
- bpfcc-tools
stage-packages:
- libsystemd0
- libbpfcc
- bpfcc-tools
override-build: |
export USE_CONTAINER=0
export GOFLAGS="-mod=readonly -tags=promtail_journal_enabled"
make agent agentctl
cp build/grafana-agent $CRAFT_PART_INSTALL/agent
cp build/grafana-agentctl $CRAFT_PART_INSTALL/agentctl