Skip to content

Commit

Permalink
feat: use app.GetHandlerName replace of reflect value (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
loveyana authored Feb 2, 2024
1 parent 8239b48 commit a4af131
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tracing/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ import (
// Ref to https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#name
// naming rule: $HandlerName:$FullPath
func serverSpanNaming(c *app.RequestContext) string {
return c.HandlerName() + ":" + c.FullPath()
handlerName := app.GetHandlerName(c.Handler())
if handlerName == "" {
handlerName = c.HandlerName()
}
return handlerName + ":" + c.FullPath()
}

func clientSpanNaming(req *protocol.Request) string {
Expand Down

0 comments on commit a4af131

Please sign in to comment.