diff --git a/CHANGELOG.md b/CHANGELOG.md index 04afa8db6148..a12e820ddf37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -101,6 +101,8 @@ Main (unreleased) ### Bugfixes +- Set exit code 1 on grafana-agentctl non-runnable command. (@fgouteroux) + - Fixed an issue where `loki.process` validation for stage `metric.counter` was allowing invalid combination of configuration options. (@thampiotr) diff --git a/cmd/grafana-agentctl/main.go b/cmd/grafana-agentctl/main.go index 6865a4bc412d..5219f85a0f2f 100644 --- a/cmd/grafana-agentctl/main.go +++ b/cmd/grafana-agentctl/main.go @@ -64,7 +64,9 @@ func main() { testLogs(), ) - _ = cmd.Execute() + if err := cmd.Execute(); err != nil { + os.Exit(1) + } } func configSyncCmd() *cobra.Command {