From 546159722b6a07cb6d6b4cb3d626d782597054f5 Mon Sep 17 00:00:00 2001 From: kruskall <99559985+kruskall@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:12:26 +0100 Subject: [PATCH] feat(moxy): return empty agentcfg instead of logging an error (#177) apm-server will use the es fetcher to search for agentcfg return an empty response to avoid logging errors --- internal/proxy/stub_es.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/proxy/stub_es.go b/internal/proxy/stub_es.go index c2cf86b..e46615e 100644 --- a/internal/proxy/stub_es.go +++ b/internal/proxy/stub_es.go @@ -86,6 +86,10 @@ func (h stubES) ServeHTTP(w http.ResponseWriter, req *http.Request) { case "/": _, _ = w.Write(h.info) return + case "/.apm-agent-configuration/_search": + w.Header().Set("Content-Type", "application/json") + _, _ = w.Write([]byte(`{}`)) + w.WriteHeader(http.StatusOK) case "/_license": _, _ = w.Write(h.license) return