Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix(alertmanager): send empty array instead of nil (#7312)

Vibhu Pandeyf96a234faabf
diff --git a/pkg/alertmanager/api.go b/pkg/alertmanager/api.go
index 1f7e7bbaa7..b71cbb2034 100644
--- a/pkg/alertmanager/api.go
+++ b/pkg/alertmanager/api.go
@@ -97,6 +97,11 @@ func (api *API) ListChannels(rw http.ResponseWriter, req *http.Request) {
return
}
+ // This ensures that the UI receives an empty array instead of null
+ if len(channels) == 0 {
+ channels = make([]*alertmanagertypes.Channel, 0)
+ }
+
render.Success(rw, http.StatusOK, channels)
}