allow retrieving spans from fiber.Ctx

This commit is contained in:
2024-05-20 11:04:36 +02:00
parent 77ab12c3ac
commit 372f4367ed
2 changed files with 12 additions and 0 deletions

View File

@ -39,6 +39,12 @@ func main() {
}))
defer tracing.ShutdownTracer()
main.Use(func(c *fiber.Ctx) error {
span := tracing.SpanFromContext(c)
span.AddEvent("pushed into a span an event from middleware")
return c.Next()
})
main.Get("/", Handler)
// handle interrupts (shutdown)