go back to using OriginalURL to better support salego which uses Groups on fiber.Router

This commit is contained in:
Natalia Goc 2024-05-21 08:16:26 +02:00
parent d7b45a1439
commit d708f9ae04
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ func Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption)
// NOTE: You can use [trace.WithAttributes] as a parameter to opts argument // NOTE: You can use [trace.WithAttributes] as a parameter to opts argument
// Returns [c.UserContext] as [context.Context] // Returns [c.UserContext] as [context.Context]
func FStart(c *fiber.Ctx, opts ...trace.SpanStartOption) (context.Context, trace.Span) { func FStart(c *fiber.Ctx, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
return Tracer.Start(c.UserContext(), c.Method()+" "+c.Route().Path, opts...) return Tracer.Start(c.UserContext(), c.Method()+" "+c.OriginalURL(), opts...)
} }
// Just like [FStart] but makes it possible to assign custom span name. // Just like [FStart] but makes it possible to assign custom span name.

View File

@ -71,7 +71,7 @@ func new(config ...middlewareConfig) fiber.Handler {
otelCtx, span := Tracer.Start( otelCtx, span := Tracer.Start(
c.UserContext(), c.UserContext(),
c.Method()+" "+c.Route().Path, c.Method()+" "+c.OriginalURL(),
opts..., opts...,
) )