added event wrappers, bug fixes, API improvements

This commit is contained in:
2024-05-17 18:21:09 +02:00
parent 4f4a7e09c5
commit 076196c03e
7 changed files with 218 additions and 49 deletions

View File

@ -45,7 +45,8 @@ func Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption)
// NOTE: You can use [trace.WithAttributes] as a parameter to opts argument
func FStart(c *fiber.Ctx, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
return fiberOpentelemetry.Tracer.Start(c.UserContext(), c.Method()+" "+c.Path(), opts...)
ctx := fiberOpentelemetry.FromCtx(c)
return fiberOpentelemetry.Tracer.Start(ctx, c.Method()+" "+c.Path(), opts...)
}
func NewMiddleware(config Config) func(*fiber.Ctx) error {