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
Any time a developer wants to mutate their event data before it's sent to Sentry they need to use a beforeX hook.
These hooks provide serialized events to work with which is convenient for evaluating an event's key's values but inconvenient for mutating the event without access to any of the event methods.
Example:
I want to upcycle a spans duration into a custom metric:
Problem Statement
Any time a developer wants to mutate their event data before it's sent to Sentry they need to use a beforeX hook.
These hooks provide serialized events to work with which is convenient for evaluating an event's key's values but inconvenient for mutating the event without access to any of the event methods.
Example:
I want to upcycle a spans duration into a custom metric:
This metric is not connected to the sampled span and this API will be going away.
I can't use span.setAttribute here because the span is already serialized.
Solution Brainstorm
Provide lifecycle hooks that can hook into events prior to serialization so that event methods can be used on them.
The text was updated successfully, but these errors were encountered: