From 390afa249028cee203fe594fb20bb130bd7a8031 Mon Sep 17 00:00:00 2001 From: Julian Sommer <115516918+juliansommer@users.noreply.github.com> Date: Wed, 5 Aug 2026 15:34:55 +1000 Subject: [PATCH] fix: log AWS actions in gateway requests (#735) --- spinifex/gateway/gateway.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spinifex/gateway/gateway.go b/spinifex/gateway/gateway.go index c5e30de3c..e2bb6d6c5 100644 --- a/spinifex/gateway/gateway.go +++ b/spinifex/gateway/gateway.go @@ -341,7 +341,8 @@ func (gw *GatewayConfig) writeThrottleError(w http.ResponseWriter, r *http.Reque func (gw *GatewayConfig) Request(w http.ResponseWriter, r *http.Request) { svc, err := gw.GetService(r) - slog.Info("Request", "service", svc, "method", r.Method, "path", r.URL.Path) + action, _ := r.Context().Value(ctxAction).(string) + slog.Info("Request", "service", svc, "action", action, "method", r.Method, "path", r.URL.Path) if err != nil { slog.Error("GetService error", "error", err) @@ -388,10 +389,10 @@ func (gw *GatewayConfig) Request(w http.ResponseWriter, r *http.Request) { } if err != nil { - slog.Error("Service request error", "service", svc, "error", err) + slog.Error("Service request error", "service", svc, "action", action, "error", err) gw.ErrorHandler(w, r, err) } else { - slog.Info("Service request completed", "service", svc) + slog.Info("Service request completed", "service", svc, "action", action) } }