diff --git a/context.go b/context.go index d2ed254..bbbf00f 100644 --- a/context.go +++ b/context.go @@ -69,6 +69,7 @@ func ContextMiddleware( ) cc := NewContext(c, newRelicApp, logger, correlationID, isDebug, buildVersion) + defer cc.NewRelicTx.End() return h(cc) } @@ -88,7 +89,6 @@ func NewContext( echoCtx.Response().Writer, echoCtx.Request(), ) - defer func() { _ = newRelicTx.End() }() // new relic tx wraps response writer echoCtx.Response().Writer = newRelicTx