-
Notifications
You must be signed in to change notification settings - Fork 0
Add spans #3
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
Add spans #3
Conversation
9ef4f61
to
6543d8b
Compare
f4972eb
to
708cc90
Compare
6543d8b
to
5826715
Compare
instrumentation/grape/lib/opentelemetry/instrumentation/grape/instrumentation.rb
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/instrumentation.rb
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/instrumentation.rb
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/instrumentation.rb
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb
Outdated
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb
Outdated
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb
Outdated
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb
Outdated
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/instrumentation.rb
Outdated
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/subscriber.rb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor nitpicks (like really nitpicky) but this is beautifully written, kudos 🍻
for me the instrumentation seems to be on point, the only addition I would say is the context is missing i.e. the request parameters and the user session information. These can of course be something added with a future PR. They will also need us to implement a filtering mechanism so as not to leak PII info (especially for the session info).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've put some changes here I think that are needed for clarity. Some I think might be a bit too verbose, but others that I think help to understand what's going on (especially with handle_error
).
instrumentation/grape/lib/opentelemetry/instrumentation/grape/subscriber.rb
Outdated
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb
Outdated
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/subscriber.rb
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/subscriber.rb
Show resolved
Hide resolved
instrumentation/grape/lib/opentelemetry/instrumentation/grape/event_handler.rb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -41,11 +34,12 @@ def gem_version | |||
end | |||
|
|||
def require_dependencies | |||
require_relative 'handler' | |||
require_relative 'subscriber' | |||
require_relative 'event_handler' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also move this into subscriber
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done 😄
I'll merge it into |
I like to write PR descriptions but there's no reasonable description I could write to capture all the context needed here 😅
I'll still give it a shot:
Description
The goal of this PR is to implement the Grape instrumentation for OpenTelemetry. It borrows (or steals) a lot from the Datadog implementation but also differs in some substantial aspects that I tried to explain in comments throughout the PR.
This PR completes the changes made in the
add-grape-instrumentation
branch. That branch had the autogenerated files with some basic changes. This branch contains the "meat" of the implementation and the goal is to merge it intoadd-grape-instrumentation
to have a complete PR we can send upstream.Last but not least, remember that this will still go through code review by the maintainers so if we can't choose among alternatives or have uncertainties, we can still raise them up to them and ask for comments or advice.