Skip to content

Commit 7d06fc6

Browse files
committed
[CHORE] set request.Pattern in otelecho since echo doesnt set it yet
1 parent 0cac051 commit 7d06fc6

File tree

1 file changed

+2
-1
lines changed
  • instrumentation/github.com/labstack/echo/otelecho

1 file changed

+2
-1
lines changed

instrumentation/github.com/labstack/echo/otelecho/echo.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ func Middleware(service string, opts ...Option) echo.MiddlewareFunc {
6161
c.SetRequest(request)
6262
}()
6363
ctx := cfg.Propagators.Extract(savedCtx, propagation.HeaderCarrier(request.Header))
64+
request.Pattern = c.Path()
6465
opts := []oteltrace.SpanStartOption{
6566
oteltrace.WithAttributes(hs.RequestTraceAttrs(service, request)...),
66-
oteltrace.WithAttributes(hs.Route(c.Path())),
67+
oteltrace.WithAttributes(hs.Route(request.Pattern)),
6768
oteltrace.WithSpanKind(oteltrace.SpanKindServer),
6869
}
6970
spanName := spanNameFormatter(c)

0 commit comments

Comments
 (0)