opentelemetry-go-contrib icon indicating copy to clipboard operation
opentelemetry-go-contrib copied to clipboard

change the Filter parameter from *http.Request to *gin.Context

Open soyacen opened this issue 2 years ago • 4 comments

change the Filter parameter from *http.Request to *gin.Context.

gin.Context has FullPath() method, which returns a matched route full path.

// router.GET("/user/:id", func(c *gin.Context) { // c.FullPath() == "/user/:id" // true // })

soyacen avatar Dec 08 '22 09:12 soyacen

@soyacen Can you add the link to the .go file?

rehanpfmr avatar Jun 16 '23 07:06 rehanpfmr

I suppose this is the option being mentioned: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/github.com/gin-gonic/gin/otelgin/option.go#L78

Which is used here: https://github.com/open-telemetry/opentelemetry-go-contrib/blob/main/instrumentation/github.com/gin-gonic/gin/otelgin/gintrace.go#L57

@rehanpfmr this should be a straightforward change. If you want to take it, feel free to do so.

dmathieu avatar Jun 16 '23 07:06 dmathieu

@soyacen @dmathieu Please assign this to me.

rehanpfmr avatar Aug 01 '23 07:08 rehanpfmr

FullPath is already being used as the span name, so that half of this ticket can be ignored.

riking avatar Dec 07 '23 21:12 riking