Skip to content

Add OpenTracing instrumentation for Action View Render events

Andrew Newdigate requested to merge an-opentracing-render-tracing into master

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?

Edited by Andrew Newdigate

Merge request reports