Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contrib/jinzhu/gorm: add gorm integration #268

Merged
merged 5 commits into from
Sep 12, 2018
Merged

contrib/jinzhu/gorm: add gorm integration #268

merged 5 commits into from
Sep 12, 2018

Conversation

gbbr
Copy link
Contributor

@gbbr gbbr commented Jun 26, 2018

Closes #100

  • Unit test
  • Example
  • Test with Datadog

@gbbr gbbr added apm:ecosystem contrib/* related feature requests or bugs feature-request labels Jun 26, 2018
@gbbr gbbr self-assigned this Jun 26, 2018
@gbbr gbbr added this to the 1.1.0 milestone Jun 27, 2018
@gbbr gbbr requested a review from palazzem June 27, 2018 12:55
@gbbr gbbr modified the milestones: 1.1.0, next Aug 6, 2018
@gbbr gbbr requested review from dd-caleb and removed request for palazzem August 6, 2018 14:37

// Open opens a new (traced) database connection. The used dialect must be formerly registered
// using (gopkg.in/DataDog/dd-trace-go.v1/contrib/database/sql).Register.
func Open(dialect, source string) (*gorm.DB, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gorm.Open supports both a database string or passing the actual database through... I was wondering if we should try to do the same, but I guess there's really no value in supporting both since there's no way to take an existing db and add tracing too it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I will try and investigate it.

Copy link
Contributor

@dd-caleb dd-caleb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bwiggs
Copy link

bwiggs commented Sep 10, 2018

I'm looking to add tracing to our database layer and we use gorm. Any updates on this and working with v1?

@gbbr
Copy link
Contributor Author

gbbr commented Sep 11, 2018

@bwiggs Does this solution work for you? Am happy to merge it and get it out for 1.3.0 along with some other integration PRs that are open.

@gbbr gbbr modified the milestones: next, 1.3.0 Sep 11, 2018
@bwiggs
Copy link

bwiggs commented Sep 11, 2018

Yip, I loaded your gbbr/gorm branch into my app and updated my gorm.Open to gormtrace.Open. I then started to see sql queries in APM.

@gbbr
Copy link
Contributor Author

gbbr commented Sep 11, 2018

Nice! Thanks for confirming that.

@gbbr gbbr merged commit 349464e into v1 Sep 12, 2018
@gbbr gbbr deleted the gbbr/gorm branch September 12, 2018 07:24
mingrammer pushed a commit to mingrammer/dd-trace-go that referenced this pull request Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:ecosystem contrib/* related feature requests or bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants