Skip to content

Commit

Permalink
Allow CE gateway to proxy telemetry handler from OEM/Pro backend
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Nov 29, 2024
1 parent ab2c34b commit 2fb748e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gateway/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions gateway/types/handler_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2fb748e

Please sign in to comment.