-
Notifications
You must be signed in to change notification settings - Fork 0
[SERF-3423] Adding MySQL driver instrumentation #112
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
Conversation
fc2cd39
to
68f5a6f
Compare
68f5a6f
to
fc38460
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM 🚀
1653149
to
0e2d409
Compare
7896ed7
to
d3b9e5c
Compare
pkg/database/gorm.go
Outdated
dbServiceName := fmt.Sprintf("%s-mysql", appName) | ||
driverServiceName := fmt.Sprintf("%s-orm", appName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think those need to be the other way around? 🤔
The (MySQL) driver is %s-mysql
and the db (ORM) is %s-orm
.
dbServiceName := fmt.Sprintf("%s-mysql", appName) | |
driverServiceName := fmt.Sprintf("%s-orm", appName) | |
dbServiceName := fmt.Sprintf("%s-orm", appName) | |
driverServiceName := fmt.Sprintf("%s-mysql", appName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current value for dbServiceName
is with -mysql
, this way we will have document-search-orm
instead.
Maybe change driverServiceName
to appname-dbdriver
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @fotos about the naming: the -orm
should be assigned to the gorm
instrumentation, and the -mysql
to the MySQL driver instrumentation.
@laynax If we change the name for the gORM instrumentation, what happens? I think the only thing will change is the DataDog metric names, which we will need to update anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed as requested 👍
Overall I'm against having more than one service name for each service, it must be the operation name providing info about orm
or mysql
type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fotos A brief update here. After discussing this PR with @laynax we decided to keep the service name as is %s-mysql
(document-search-mysql
) as it will make things easier and effectively a part of one database
flow. One can distinguish between different span types using the operation type drop-down (see screenshot). Please, let us know what you think about this 🙏
@laynax Let's update the service name here using -mysql
suffix for both clients 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me!
Let's see how that works in practice. 👍
d3b9e5c
to
dc5db8c
Compare
dc5db8c
to
fc38460
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
Description
This PR adds MySQL driver tracing using
dd-trace-go
library.Testing considerations
Tested on
document-search
staging.Sample span:

Checklist
development
and/orstaging
README.md
as necessaryRelated links