You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to instrument my ViewComponents with Sentry Traces so I know how long things are taking. Sentry hooks into the stock Rails stuff amazingly well, and you can add your own custom timing entries. The Sentry docs have you surround your code in a Sentry.with_child_span block and they take care of the rest. I've done this with some other API call stuff and it works great (request.operator in the example below are my custom ones):
I've got an ApplicationComponent that's the parent class of all of my components, which would be an ideal place to put it. But, I've only seen a before_render lifecycle hook. Is there a secret undocumented around_render hook maybe? Or another technique I can use to implement this tracing, without surrounding every single component render with that block in every view.
The first syntax I came up with off the top of my head was something like:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'd like to instrument my ViewComponents with Sentry Traces so I know how long things are taking. Sentry hooks into the stock Rails stuff amazingly well, and you can add your own custom timing entries. The Sentry docs have you surround your code in a
Sentry.with_child_span
block and they take care of the rest. I've done this with some other API call stuff and it works great (request.operator
in the example below are my custom ones):I've got an
ApplicationComponent
that's the parent class of all of my components, which would be an ideal place to put it. But, I've only seen abefore_render
lifecycle hook. Is there a secret undocumentedaround_render
hook maybe? Or another technique I can use to implement this tracing, without surrounding every single component render with that block in every view.The first syntax I came up with off the top of my head was something like:
Beta Was this translation helpful? Give feedback.
All reactions