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

Auto instrumentation for go-redis #505

Merged
merged 10 commits into from
Apr 29, 2019
Merged

Auto instrumentation for go-redis #505

merged 10 commits into from
Apr 29, 2019

Conversation

aspacca
Copy link
Contributor

@aspacca aspacca commented Apr 13, 2019

addresses #489

@@ -6,5 +6,5 @@
if test -z "$(go env GOMOD)"; then
pwd
else
find -type f -name go.mod \! -path './vendor/*' -printf "%h\n"
find . -type f -name go.mod \! -path './vendor/*' -exec dirname '{}' \;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is just a fix to be not-GNU compatible

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

Thank you for the comprehensive tests, this is fantastic.

Some of my comments are for things I should have caught in my earlier pass over the code - sorry. Glad to see that your changes were accepted to go-redis, it makes the instrumentation much nicer.

module/apmgoredis/client.go Outdated Show resolved Hide resolved
module/apmgoredis/client.go Outdated Show resolved Hide resolved
module/apmgoredis/client.go Outdated Show resolved Hide resolved
module/apmgoredis/client.go Outdated Show resolved Hide resolved
module/apmgoredis/client.go Outdated Show resolved Hide resolved
module/apmgoredis/client_test.go Outdated Show resolved Hide resolved
module/apmgoredis/integration_test.go Outdated Show resolved Hide resolved
module/apmgoredis/integration_test.go Outdated Show resolved Hide resolved
module/apmgoredis/integration_test.go Outdated Show resolved Hide resolved
module/apmgoredis/integration_test.go Outdated Show resolved Hide resolved
@axw
Copy link
Member

axw commented Apr 15, 2019

@aspacca I've just merged a change into master which fixes the test failure in https://travis-ci.org/elastic/apm-agent-go/jobs/520141217. You'll need to rebase or merge master to get that.

There are some other CI failures due to formatting, e.g. https://travis-ci.org/elastic/apm-agent-go/jobs/520141216. You can fix that with make fmt.

Finally, you will need to sign the CLA before I can merge this.

@codecov-io
Copy link

codecov-io commented Apr 15, 2019

Codecov Report

Merging #505 into master will increase coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #505      +/-   ##
==========================================
+ Coverage   84.08%   84.09%   +0.01%     
==========================================
  Files         113      114       +1     
  Lines        6674     6729      +55     
==========================================
+ Hits         5612     5659      +47     
- Misses        758      766       +8     
  Partials      304      304
Impacted Files Coverage Δ
module/apmgoredis/client.go 85.45% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1bfd587...417a2bf. Read the comment docs.

@aspacca
Copy link
Contributor Author

aspacca commented Apr 17, 2019

@axw everything should be fine now

@axw
Copy link
Member

axw commented Apr 17, 2019

Thanks @aspacca. I'm away on vacation at the moment, I will finish reviewing next week.

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

Just one little thing, otherwise LGTM. Thank you!
After the comment addition, is this good to merge?


// Wrap wraps client such that executed commands are reported as spans to Elastic APM,
// using the client's associated context.
// A context-specific client may be obtained by using Client.WithContext.
Copy link
Member

Choose a reason for hiding this comment

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

It appears from the tests that not everything works with Ring. Can you please add a comment here explaining what isn't supported, linking to issues if there are any?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ring has not TxPipeline/TxPipelined implemented, it's not related to the instrumentation with the apm agent, do you want me to add a comment for this?

While, related to instrumentation, it works with Ring on Pipeline/Pipelined but not for direct command on the client: this PR redis/go-redis#1017 will address

For me it's ok to wait for that PR to be merged, and then remove the special case in the test here

Copy link
Member

Choose a reason for hiding this comment

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

I see, thanks. I'd prefer to wait for redis/go-redis#1017 to merge first, to avoid a little bit of churn.

@aspacca
Copy link
Contributor Author

aspacca commented Apr 25, 2019

redis/go-redis#1017 merged, pushed final commit here

@axw
Copy link
Member

axw commented Apr 25, 2019

I ran the docker tests locally, and I'm seeing this error occur in the integration tests:

Received unexpected error:      
CLUSTERDOWN Hash slot not served

Any ideas what's going on there?

@aspacca
Copy link
Contributor Author

aspacca commented Apr 25, 2019 via email

@axw
Copy link
Member

axw commented Apr 25, 2019

redis cluster was not setup properly

This is the case, but unrelated to timing. Logs from redis-cluster:

redis-cluster_1          | Unrecognized option or bad number of args for: '--cluster'

Looks like an issue with the entrypoint commant. I'll have to wait until I have some time to debug this before merging, as I don't want local testing to be blocked.

@aspacca
Copy link
Contributor Author

aspacca commented Apr 25, 2019 via email

@aspacca
Copy link
Contributor Author

aspacca commented Apr 25, 2019 via email

@axw
Copy link
Member

axw commented Apr 25, 2019

the case could be also that you don’t have updated redis:latest image :)

I tried that already, it wasn't it. The --cluster flag is there, it's something to do with the args being passed into it. Possibly related to the order of services coming up? Really just guessing at the moment.

EDIT: maybe it was a stale image after all. I might've failed to recreate the service. It seems to be working now. I'll run some more tests and merge it once I'm confident it's not going to recur.

@axw
Copy link
Member

axw commented Apr 29, 2019

Looks like it was me after all, I've run it a bunch of times without any failures.

@axw axw merged commit 8743196 into elastic:master Apr 29, 2019
@axw
Copy link
Member

axw commented Apr 29, 2019

Thanks again for your work on this, @aspacca.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants