-
Notifications
You must be signed in to change notification settings - Fork 441
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
Support valkey-go tracing #3081
Conversation
Datadog ReportBranch report: ❌ 8 Failed (0 Known Flaky), 5167 Passed, 70 Skipped, 2m 54.4s Total Time ❌ Failed Tests (8)
|
e41ab88
to
7c97f5b
Compare
7c97f5b
to
6aa8d69
Compare
11e7c51
to
2750600
Compare
2750600
to
fe59e6d
Compare
@keisku Thanks for contributing this integration! Please fix the conflicts and this should be good to go. Also remember to create the same PR against |
Signed-off-by: keisku <[email protected]>
Signed-off-by: keisku <[email protected]>
Signed-off-by: keisku <[email protected]>
Signed-off-by: keisku <[email protected]>
contrib/valkey-go/valkey.go
Outdated
skipRawCommand bool | ||
} | ||
|
||
func (c *coreClient) peerTags() []tracer.StartSpanOption { |
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.
The agent checks a list of tags to compute peer.service
, and I think both out.host
and peer.hostname
would be considered in this case. But for consistency with other integrations, I think its preferred to just set out.host
(I am asking around if this preference has changed recently and if we have any documentation about it)
contrib/valkey-go/valkey.go
Outdated
opts = append(opts, []tracer.StartSpanOption{ | ||
// valkeyotel tags | ||
tracer.Tag("db.stmt_size", input.size), | ||
tracer.Tag("db.operation", input.command), |
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.
We don't need to add obfuscation, since its already done in the agent (the code you linked). However I just noticed there's an issue, since that code will only run if span.type
is redis
, so it won't run for valkey
. I will talk to the apm-agent team about this.
But basically what we want to do here is:
if !input.skipRawCommand {
opts = append(opts, tracer.Tag(ext.ValkeyRawCommand, input.command))
}
Also it is preferred to set only the raw command tag, since its the one the agent checks for obfuscation (when the logic is updated to check for valkey as well).
787b31f
to
27b0fec
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, thanks for the contribution! @keisku
Datadog ReportBranch report: ✅ 0 Failed, 5216 Passed, 72 Skipped, 2m 45.95s Total Time |
What does this PR do?
Support https://github.com/valkey-io/valkey-go
Example:
Motivation
#2920
Reviewer's Checklist
v2-dev
branch and reviewed by @DataDog/apm-go.Unsure? Have a question? Request a review!