Closed Guillaumebeuzeboc closed 6 months ago
I tried to use the new version after this PR got merged, and it seems that the agent is still complaining about promtail being disabled.
If we look into the logs of snapcraft we can see:
2024-04-19 15:24:06.362 :: 2024-04-19 15:15:10.492 :: + export USE_CONTAINER=0
2024-04-19 15:24:06.362 :: 2024-04-19 15:15:10.493 :: + USE_CONTAINER=0
2024-04-19 15:24:06.362 :: 2024-04-19 15:15:10.493 :: + export 'GOFLAGS=-mod=readonly -tags=promtail_journal_enabled'
2024-04-19 15:24:06.362 :: 2024-04-19 15:15:10.493 :: + GOFLAGS='-mod=readonly -tags=promtail_journal_enabled'
2024-04-19 15:24:06.362 :: 2024-04-19 15:15:10.493 :: + make agent agentctl
2024-04-19 15:24:06.362 :: 2024-04-19 15:15:11.454 :: GOOS=linux GOARCH=amd64 GOARM= CGO_ENABLED=1 go build -ldflags "-X github.com/grafana/agent/pkg/build.Branch=HEAD -X github.com/grafana/agent/pkg/build.Version=v0.40.4 -X github.com/grafana/agent/pkg/build.Revision=477a074cb -X github.com/grafana/agent/pkg/build.BuildUser=root@snapcraft-grafana-agent-on-amd64-for-amd64-44042628 -X github.com/grafana/agent/pkg/build.BuildDate=2024-04-19T13:15:11Z" -tags "" -o build/grafana-agent ./cmd/grafana-agent
The -tags ""
remains empty.
So the GOFLAGS
set doesn't seem to have an impact, at least on the tags.
Setting export GO_TAGS="promtail_journal_enabled"
instead should work.
Loki source journal must be enabled (
CGO_ENABLED=1
andpromtail_journal_enabled
) at build time so that the agent can collect the systemd logs.If not enabled, configuring loki to collect journalD logs will fail at startup.