From 2fb748e03d58568309f516c215c6f2be17bf667c Mon Sep 17 00:00:00 2001 From: "Alex Ellis (OpenFaaS Ltd)" Date: Fri, 29 Nov 2024 14:51:19 +0000 Subject: [PATCH] Allow CE gateway to proxy telemetry handler from OEM/Pro backend Signed-off-by: Alex Ellis (OpenFaaS Ltd) --- gateway/main.go | 4 ++++ gateway/types/handler_set.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gateway/main.go b/gateway/main.go index 5071b1d56..712cd749a 100644 --- a/gateway/main.go +++ b/gateway/main.go @@ -129,6 +129,8 @@ func main() { faasHandlers.FunctionStatus = handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer, serviceAuthInjector) faasHandlers.InfoHandler = handlers.MakeInfoHandler(handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer, serviceAuthInjector)) + faasHandlers.TelemetryHandler = handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer, nil) + faasHandlers.SecretHandler = handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer, serviceAuthInjector) faasHandlers.NamespaceListerHandler = handlers.MakeForwardingProxyHandler(reverseProxy, forwardingNotifiers, urlResolver, nilURLTransformer, serviceAuthInjector) @@ -208,6 +210,8 @@ func main() { r.HandleFunc("/function/{name:["+NameExpression+"]+}/{params:.*}", functionProxy) r.HandleFunc("/system/info", faasHandlers.InfoHandler).Methods(http.MethodGet) + r.HandleFunc("/system/telemetry", faasHandlers.TelemetryHandler).Methods(http.MethodGet) + r.HandleFunc("/system/alert", faasHandlers.Alert).Methods(http.MethodPost) r.HandleFunc("/system/function/{name:["+NameExpression+"]+}", faasHandlers.FunctionStatus).Methods(http.MethodGet) diff --git a/gateway/types/handler_set.go b/gateway/types/handler_set.go index ee55cbace..d3de10a3e 100644 --- a/gateway/types/handler_set.go +++ b/gateway/types/handler_set.go @@ -34,6 +34,8 @@ type HandlerSet struct { // InfoHandler provides version and build info InfoHandler http.HandlerFunc + TelemetryHandler http.HandlerFunc + // SecretHandler enables secrets to be managed SecretHandler http.HandlerFunc