diff --git a/server.go b/server.go index 4025014..63e8784 100644 --- a/server.go +++ b/server.go @@ -89,6 +89,10 @@ func NewRPCServer(logger logr.Logger, } func (server *RPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { + + ctx, span := tracer.Start(r.Context(), "RPCServer.ServeHTTP") + defer span.End() + w.Header().Set("Content-Type", "application/text; charset=utf-8") canGzip := strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") @@ -111,7 +115,7 @@ func (server *RPCServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { logger = logger.WithValues("uid", reqId.String()) } - result := server.serveRequest(r.Context(), logger, payload, cltVersion, cltPlatform, cltIP) + result := server.serveRequest(ctx, logger, payload, cltVersion, cltPlatform, cltIP) server.writeResponse(canGzip, w, result.Payload) }