Add OpenTracing instrumentation for Action View Render events
What does this MR do?
Add OpenTracing instrumentation for Action View Render events
This change adds three new instrumentations, driven through rails notifications: render_template.action_view
,
render_collection.action_view
and render_partial.action_view
.
These can help developers understand why renders are taking a long time which may in turn help them to improve their performance.
Reviewer Notes
As part of this merge request, I've changed the return value of .instrument
from a subscription to a lambda, which when called will unsubscribe from all events.
This allows me to subscribe to multiple subscription in the .instrument
method while still maintaining a common interface on the .instrument
methods.
Additionally, moving to a lambda prevents us from the leaking the ActiveSupport::Notifications
out to callers. They no longer need to know that the subscription needs to be cancelled through a call to ActiveSupport::Notifications.unsubscribe
. All they need to do is call the lambda.
This will be useful in future when subscriptions may subscribe to other types of events.
What are the relevant issue numbers?
This is the final MR to spin out of the original Distributed Tracing merge request, https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21280
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the database guides -
Link to e2e tests MR added if this MR has Requires e2e tests label. See the Test Planning Process. -
Security reports checked/validated by reviewer