Skip to content

Commit

Permalink
fix: scope ingress logs with the request signature (#2533)
Browse files Browse the repository at this point in the history
Fixes #2517
  • Loading branch information
alecthomas authored Aug 29, 2024
1 parent 3688801 commit 0ef686b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/controller/ingress/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"time"

Expand All @@ -30,8 +31,8 @@ func Handle(
r *http.Request,
call func(context.Context, *connect.Request[ftlv1.CallRequest], optional.Option[model.RequestKey], optional.Option[model.RequestKey], string) (*connect.Response[ftlv1.CallResponse], error),
) {
logger := log.FromContext(r.Context())
logger.Debugf("%s %s", r.Method, r.URL.Path)
logger := log.FromContext(r.Context()).Scope(fmt.Sprintf("ingress:%s:%s", r.Method, r.URL.Path))
logger.Debugf("Start ingress request")
route, err := GetIngressRoute(routes, r.Method, r.URL.Path)
if err != nil {
if errors.Is(err, dalerrs.ErrNotFound) {
Expand Down

0 comments on commit 0ef686b

Please sign in to comment.