-
Notifications
You must be signed in to change notification settings - Fork 91
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
kafka-go instrumentation #709
kafka-go instrumentation #709
Conversation
General concerns:
|
|
I think this is ready to be merged. Please let me know if there are still any concerns 🙏 |
@RonFed this just has some merge conflicts (we removed the examples/go.mod and go.sum in #650) We discussed the stability question about this in the sig meeting yesterday and how it relates to component ownership. We came down to 2 main takeaways:
That said, I think we can merge this as no one seems to have a problem with (1) us owning the instrumentation and (2) it being clearly marked as under an experimental set of conventions. For (2) I created #776 |
@damemi thanks for the feedback, those are good points. |
This PR adds auto instrumentation for kafka-go library.
Instrumentation
Producer
Probing the Writer.WriteMessages function. Which produces a batch of messages, possibly on different topics.
Consumer
Probing the Reader.FetchMessage function. Which is a blocking function by its nature, we start a consumer span when it returns, and end a span in the entry probe (A typical consumer calls this function in a loop).
Producer-Consumer context propagation
Done with the headers in a kafka message, using the "traceparent" header.
General updates to support the instrumentatrion
Probe.ProcessFn
to return a slice ofSpanEvents
instead of a single one.start.sh
script insample-job.yml
append_item_to_slice
to perform less write operations.Example
Added example dmenonstraing the instrumentation. The example contains an http server which produces to kafka, a consumer which creates manual spans.