dd-trace-go icon indicating copy to clipboard operation
dd-trace-go copied to clipboard

Request: example for custom tags for `contrib/gorm.io`

Open duxing opened this issue 2 years ago • 1 comments

hi DataDog team,

dd-trace-go supports gorm@v1 and gorm@v2 and I'm comparing the DataDog instrumentation implementation for both versions, trying to understand what would be the impact of upgrading my services from gorm@v1 to gorm@v2.

one thing I noticed is: instrumentation lib for gorm@v1 comes with an option to add custom tag: WithCustomTag, and I don't see an equivalent option in gorm@v2 (reference)

would it be possible for you to share an example of how to add custom tags using dd-trace-go for gorm@v2? if it's not supported yet, would it be possible to add to dd-trace-go/contrib/gorm.io?

Thanks in advance!

duxing avatar May 25 '22 21:05 duxing

seems like gorm@v2 instrumentation doesn't have that option available: reference

(equivalent of gorm@v1 implementation is missing)

[contrib/database/sql] contains a method for specifying span tags: https://pkg.go.dev/gopkg.in/DataDog/dd-trace-go.v1/contrib/database/sql#WithSpanTags. I guess that's an option?

duxing avatar May 25 '22 22:05 duxing

Closed due to merged PR #1359. If there are related problems, please open a separate issue.

zarirhamza avatar Mar 15 '23 10:03 zarirhamza