dd-trace-go
dd-trace-go copied to clipboard
Request: example for custom tags for `contrib/gorm.io`
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!
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?
Closed due to merged PR #1359. If there are related problems, please open a separate issue.