Skip to content

Commit 7e51d4b

Browse files
authored
Don't attempt to show prometheus metrics if URL is empty (#3152)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
1 parent c011e67 commit 7e51d4b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

restapi/admin_info.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,10 @@ func getAdminInfoResponse(session *models.Principal, params systemApi.AdminInfoP
881881
prometheusURL := ""
882882

883883
if !*params.DefaultOnly {
884-
prometheusURL = getPrometheusURL()
884+
promURL := getPrometheusURL()
885+
if promURL != "" {
886+
prometheusURL = promURL
887+
}
885888
}
886889

887890
mAdmin, err := NewMinioAdminClient(params.HTTPRequest.Context(), session)

0 commit comments

Comments
 (0)