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

Adds instrumentation for rdkafka #978

Merged

Conversation

andyfleming
Copy link
Contributor

Closes #919.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Oct 8, 2021

CLA Signed

The committers are authorized under a signed CLA.

…gemspec

Co-authored-by: Francis Bogsanyi <francis.bogsanyi@shopify.com>
Copy link
Contributor

@arielvalentin arielvalentin left a comment

Choose a reason for hiding this comment

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

Thanks @andyfleming for your contribution!

I left a few questions and comments for you to review.

module Consumer
def each
super do |message|
attributes = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Although it is not heavily in use in other instrumentations, I would ask you to consider using the Semantic Conventions Gem to reference these keys.

https://github.com/open-telemetry/opentelemetry-ruby/blob/main/semantic_conventions/lib/opentelemetry/semantic_conventions/trace.rb#L215

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we're using it in any other instrumentation gem. Should we just do a wholesale swap to it in another PR? Did we decide if we wanted every instrumentation gem to use this? I think yes.

instrumentation/rdkafka/Appraisals Outdated Show resolved Hide resolved
module Rdkafka
module Patches
# CustomerGetter for needed for propagation
class CustomGetter
Copy link
Contributor

Choose a reason for hiding this comment

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

@open-telemetry/ruby-maintainers Does it make sense to extract this into a SymbolMapGetter and make it part of higher level package?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah we should definitely extract it out, seems like it would be something that could get re-used again in the future.

We have the rack one here. I'm guessing this could live in the same folder under the api as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm kind of wishing we didn't include that in the API gem 😞 . I know it's convenient. I feel like it belongs in a convenience gem, like opentelemetry-common.

Co-authored-by: Ariel Valentin <arielvalentin@users.noreply.github.com>
andyfleming and others added 4 commits October 19, 2021 10:04
@andyfleming
Copy link
Contributor Author

Thanks all for the comments. I think I've addressed all of the open issues. 👍

Comment on lines 54 to 57
if error
span.record_exception(error)
span.status = OpenTelemetry::Trace::Status.error("Unhandled exception of type: #{e.class}")
end
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure this is correct. IIUC, the error here comes from the receive operation. It isn't logically part of the process operation. I think we just want the default error handling behaviour from in_span here.

Suggested change
if error
span.record_exception(error)
span.status = OpenTelemetry::Trace::Status.error("Unhandled exception of type: #{e.class}")
end

@fbogsany
Copy link
Contributor

There's a bunch of Rubocop failures 😞

@andyfleming
Copy link
Contributor Author

andyfleming commented Mar 30, 2022

Feedback addressed and lint errors resolved 👍

@andyfleming
Copy link
Contributor Author

It looks like rdkafka-ruby is not supported on windows.

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.

rdkafka-ruby instrumentation
6 participants