In https://github.com/buildkite/buildkite-agent-metrics/pull/203 in //collector/collector.go we used error wrapping to exit with code 4 on a 401 response from the agent metrics API. However this was only done in the conditional branch when no queues are specified (i.e. ingest metrics for all queues). Hence when specifying a queue via -queue CLI flag, we do not get the exit on status code 401.
Intent
Exit on 401 response in the conditional branch where len(c.Queues) != 0 for parity with len(c.Queues) == 0.
Context
In https://github.com/buildkite/buildkite-agent-metrics/pull/203 in
//collector/collector.go
we used error wrapping to exit with code 4 on a 401 response from the agent metrics API. However this was only done in the conditional branch when no queues are specified (i.e. ingest metrics for all queues). Hence when specifying a queue via-queue
CLI flag, we do not get the exit on status code 401.Intent
Exit on 401 response in the conditional branch where
len(c.Queues) != 0
for parity withlen(c.Queues) == 0
.Reviewers
@triarius @DrJosh9000 PTAL.