Skip to content

Commit

Permalink
Revert "contrib/gin-gonic/gin: correct resource name" (#587)
Browse files Browse the repository at this point in the history
This reverts commit b12f0fe.

With this change, github.com/gin-gonic/[email protected] is no longer supported. That is ok, but we want to cut a version without this fix.

This fix will be restored, targeting v1.21.1.
  • Loading branch information
knusbaum committed Feb 7, 2020
1 parent 7704362 commit 476eb07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions contrib/gin-gonic/gin/gintrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func TestTrace200(t *testing.T) {
assert.Equal("http.request", span.OperationName())
assert.Equal(ext.SpanTypeWeb, span.Tag(ext.SpanType))
assert.Equal("foobar", span.Tag(ext.ServiceName))
assert.Contains(span.Tag(ext.ResourceName), "GET /user/:id")
assert.Contains(span.Tag(ext.ResourceName), "gin.TestTrace200")
assert.Equal("200", span.Tag(ext.HTTPCode))
assert.Equal("GET", span.Tag(ext.HTTPMethod))
// TODO(x) would be much nicer to have "/user/:id" here
Expand Down Expand Up @@ -311,7 +311,7 @@ func TestResourceNamerSettings(t *testing.T) {
router.GET("/test", func(c *gin.Context) {
span, ok := tracer.SpanFromContext(c.Request.Context())
assert.True(ok)
assert.Equal(span.(mocktracer.Span).Tag(ext.ResourceName), "GET /test")
assert.Equal(span.(mocktracer.Span).Tag(ext.ResourceName), c.HandlerName())
})

r := httptest.NewRequest("GET", "/test", nil)
Expand Down
2 changes: 1 addition & 1 deletion contrib/gin-gonic/gin/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ func WithResourceNamer(namer func(c *gin.Context) string) Option {
}

func defaultResourceNamer(c *gin.Context) string {
return c.Request.Method + " " + c.FullPath()
return c.HandlerName()
}

0 comments on commit 476eb07

Please sign in to comment.