Skip to content

Commit

Permalink
Set service name from http parameters as tag on span
Browse files Browse the repository at this point in the history
  • Loading branch information
Beachman4 committed May 27, 2021
1 parent 9074381 commit 171b689
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contrib/gofiber/fiber.v2/fiber.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ func Middleware(opts ...Option) func(c *fiber.Ctx) error {
}
resourceName = c.Method() + " " + resourceName
span.SetTag(ext.ResourceName, resourceName)
service := c.Params("service", "")

if service != "" {
span.SetTag("service", service)
}

c.Context().SetUserValue("span", span.Context())

// pass the execution down the line
Expand Down

0 comments on commit 171b689

Please sign in to comment.