diff --git a/CHANGELOG.md b/CHANGELOG.md index c0fbe90b9c32..81a76d3b0770 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ - [ENHANCEMENT] Go 1.17 is now used for all builds of the Agent. (@tpaschalis) +- [BUGFIX] Fixed issue where Grafana Agent may panic if there is a very large + WAL loading while old WALs are being deleted or the `/agent/api/v1/targets` + endpoint is called. (@tpaschalis) + # v0.22.0 (2022-01-13) This release has deprecations. Please read [DEPRECATION] entries and consult diff --git a/pkg/metrics/instance/manager.go b/pkg/metrics/instance/manager.go index a27012e63a10..a622d073b0f2 100644 --- a/pkg/metrics/instance/manager.go +++ b/pkg/metrics/instance/manager.go @@ -149,6 +149,9 @@ func (m *BasicManager) ListInstances() map[string]ManagedInstance { res := make(map[string]ManagedInstance, len(m.processes)) for name, process := range m.processes { + if process == nil { + continue + } res[name] = process.inst } return res