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/Shopify/sarama: add support for tracing the sarama kafka package #296

Merged
merged 7 commits into from
Sep 13, 2018

Conversation

dd-caleb
Copy link
Contributor

@dd-caleb dd-caleb commented Aug 3, 2018

Fixes #295

This PR implements wrappers for Consumer, SyncProducer and AsyncProducer. It also implements carriers for ProducerMessage and ConsumerMessage so that span contexts can be injected and extracted.

I modeled the naming and behavior after our dd-trace-java integration.

@dd-caleb dd-caleb added apm:ecosystem contrib/* related feature requests or bugs feature-request labels Aug 3, 2018
@dd-caleb
Copy link
Contributor Author

dd-caleb commented Aug 3, 2018

Looks like there are some issues with the tests. I also forgot to allow customizing the service name. Working on that now.

@dd-caleb dd-caleb added this to the next milestone Aug 6, 2018
@dd-caleb dd-caleb requested a review from gbbr August 8, 2018 13:46
@gbbr gbbr modified the milestones: next, 1.3.0 Sep 11, 2018
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

This one is now deadlocking in tests when "successes" are enabled. One of the "sync producer" tests is also failing to set the right partition and offset.

I'm not quite sure why it was passing before and isn't now...

@gbbr gbbr removed this from the 1.3.0 milestone Sep 13, 2018
@dd-caleb
Copy link
Contributor Author

I think this is related to recent changes in the upstream library. I will fix the tests.

@dd-caleb
Copy link
Contributor Author

The issue was caused by attempting to add a metadata header to the kafka producer message payload which is only supported in versions >= 0.11. The default protocol version is 0.8.2, so that explains why the test broke.

I added code to only add the header if the version is at least 0.11.

@gbbr
Copy link
Contributor

gbbr commented Sep 13, 2018

Nice! Thanks for making these changes. CI is still failing though... :-/

@dd-caleb
Copy link
Contributor Author

@gbbr I updated the test to match the example and it passed this time: https://github.com/Shopify/sarama/blob/46cf3e2cf1acef7876068f66cf69ec31aad2d0b2/sync_producer_test.go#L57

Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks!

@gbbr gbbr added this to the 1.3.0 milestone Sep 13, 2018
@gbbr gbbr merged commit bcd2036 into v1 Sep 13, 2018
@gbbr gbbr deleted the caleb/sarama branch September 13, 2018 14:50
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

2 participants