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

feat: add grpc instrumentation #1164

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hibachrach
Copy link

Copy link

linux-foundation-easycla bot commented Sep 12, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

Copy link
Contributor

@kaylareopelle kaylareopelle 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 opening this, @hibachrach! I'm excited to take a deeper look!

As far as I know, this is the first time we've brought a gem into contrib that was originally created outside the repository. There's a few things about consistency in tooling that I'd like to talk about with the SIG as part of the review. More soon.

@hibachrach
Copy link
Author

Sounds good--happy to align to y'all in any way; no attachment to anything in this PR as it stands.

Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

Hi @hibachrach! Thanks for your patience! Great to hear you're happy to align with the rest of the repo! 😄

The main differences we see between your gRPC gem and the rest of the instrumentation are:

  • Rspec instead of minitest
  • Standard instead of Rubocop
  • Changelog format
  • Unique code of conduct
  • RBS

We also want to add this gem to the GitHub actions for this repo to run tests and release the gem.

The SIG had two ideas about how to make the alignment work:

  1. Merge your PR as-is and the approvers/maintainers will submit subsequent PRs to update the tooling to make it compatible with our CI and more closely mirror the other gems.
  2. Make the updates as part of this PR, merging it in once everything is aligned. The approvers/maintainers might make branches off yours to simplify the movement, or we could describe the changes to you and let you take care of them.

I know you've mentioned you have limited time to work on this, so let us know how you'd prefer to move forward. We're really grateful for the work you've done to create the gem and for bringing it into contrib. We want to make things as smooth as we can for you.

p.s. - I left a few suggestions related to some Gruf leftovers I found when looking this over!

Comment on lines +15 to +16
spec.summary = 'Gruf instrumentation for the OpenTelemetry framework'
spec.description = 'Gruf instrumentation for the OpenTelemetry framework'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
spec.summary = 'Gruf instrumentation for the OpenTelemetry framework'
spec.description = 'Gruf instrumentation for the OpenTelemetry framework'
spec.summary = 'gRPC instrumentation for the OpenTelemetry framework'
spec.description = 'gRPC instrumentation for the OpenTelemetry framework'


module OpenTelemetry
module Instrumentation
# Contains the OpenTelemetry instrumentation for the Gruf gem
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Contains the OpenTelemetry instrumentation for the Gruf gem
# Contains the OpenTelemetry instrumentation for the gRPC gem


gem "opentelemetry-api"
gem "opentelemetry-common"
gem "opentelemetry-instrumentation-gruf", path: "../../gruf"
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this example may have been a carryover from the gruf instrumentation! Would you rather update it for the gRPC gem, or remove it and create an issue to add an example later on?

Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

Added a few suggestions to help the markdown-related CI actions pass!


## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hibachrach/opentelemetry-instrumentation-grpc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/opentelemetry-instrumentation-grpc/blob/main/CODE_OF_CONDUCT.md).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Bug reports and pull requests are welcome on GitHub at https://github.com/hibachrach/opentelemetry-instrumentation-grpc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/opentelemetry-instrumentation-grpc/blob/main/CODE_OF_CONDUCT.md).
Bug reports and pull requests are welcome on GitHub at https://github.com/open-telemetry/opentelemetry-ruby-contrib. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/CODE_OF_CONDUCT.md).


## Code of Conduct

Everyone interacting in the OpenTelemetry::Instrumentation::Grpc project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/opentelemetry-instrumentation-grpc/blob/main/CODE_OF_CONDUCT.md).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Everyone interacting in the OpenTelemetry::Instrumentation::Grpc project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/opentelemetry-instrumentation-grpc/blob/main/CODE_OF_CONDUCT.md).
Everyone interacting in the OpenTelemetry::Instrumentation::Grpc project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/open-telemetry/opentelemetry-ruby-contrib/blob/main/CODE_OF_CONDUCT.md).

Comment on lines +26 to +31
OpenTelemetry::SDK.configure do |c|
c.use 'OpenTelemetry::Instrumentation::Grpc', {
peer_service: "Example",
allowed_metadata_headers: [],
}
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
OpenTelemetry::SDK.configure do |c|
c.use 'OpenTelemetry::Instrumentation::Grpc', {
peer_service: "Example",
allowed_metadata_headers: [],
}
end
OpenTelemetry::SDK.configure do |c|
c.use 'OpenTelemetry::Instrumentation::Grpc', {
peer_service: "Example",
allowed_metadata_headers: [],
}
end

Comment on lines +38 to +40
OpenTelemetry::SDK.configure do |c|
c.use_all
end
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
OpenTelemetry::SDK.configure do |c|
c.use_all
end
OpenTelemetry::SDK.configure do |c|
c.use_all
end

Comment on lines +46 to +47
otel = OpenTelemetry::Instrumentation::Grpc.client_interceptor
SomeService::Stub.new(host, credentials, *args, **kwargs, interceptors: [otel])
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
otel = OpenTelemetry::Instrumentation::Grpc.client_interceptor
SomeService::Stub.new(host, credentials, *args, **kwargs, interceptors: [otel])
otel = OpenTelemetry::Instrumentation::Grpc.client_interceptor
SomeService::Stub.new(host, credentials, *args, **kwargs, interceptors: [otel])

Copy link
Contributor

github-actions bot commented Nov 2, 2024

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

@github-actions github-actions bot added the stale Marks an issue/PR stale label Nov 2, 2024
@kaylareopelle kaylareopelle added keep Ensures stale-bot keeps this issue/PR open and removed stale Marks an issue/PR stale labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep Ensures stale-bot keeps this issue/PR open
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to handle gRPC repo w.r.t. attribution/licensing
2 participants