Chain twirpLogger and twirpRequestStatusHook properly for the Egress server (#1470)
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
|||||||
"github.com/pion/turn/v2"
|
"github.com/pion/turn/v2"
|
||||||
"github.com/prometheus/client_golang/prometheus/promhttp"
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
||||||
"github.com/rs/cors"
|
"github.com/rs/cors"
|
||||||
|
"github.com/twitchtv/twirp"
|
||||||
"github.com/urfave/negroni/v3"
|
"github.com/urfave/negroni/v3"
|
||||||
"go.uber.org/atomic"
|
"go.uber.org/atomic"
|
||||||
"golang.org/x/sync/errgroup"
|
"golang.org/x/sync/errgroup"
|
||||||
@@ -85,7 +86,12 @@ func NewLivekitServer(conf *config.Config,
|
|||||||
twirpLoggingHook := TwirpLogger(logger.GetLogger())
|
twirpLoggingHook := TwirpLogger(logger.GetLogger())
|
||||||
twirpRequestStatusHook := TwirpRequestStatusReporter()
|
twirpRequestStatusHook := TwirpRequestStatusReporter()
|
||||||
roomServer := livekit.NewRoomServiceServer(roomService, twirpLoggingHook)
|
roomServer := livekit.NewRoomServiceServer(roomService, twirpLoggingHook)
|
||||||
egressServer := livekit.NewEgressServer(egressService, twirpLoggingHook, twirpRequestStatusHook)
|
egressServer := livekit.NewEgressServer(egressService, twirp.WithServerHooks(
|
||||||
|
twirp.ChainHooks(
|
||||||
|
twirpLoggingHook,
|
||||||
|
twirpRequestStatusHook,
|
||||||
|
),
|
||||||
|
))
|
||||||
ingressServer := livekit.NewIngressServer(ingressService, twirpLoggingHook)
|
ingressServer := livekit.NewIngressServer(ingressService, twirpLoggingHook)
|
||||||
|
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
|
|||||||
Reference in New Issue
Block a user