Dropping a transaction based on its name and duration #2213
-
Hi, On our project we have a pretty aggressive scheduler running every 5 seconds, the scheduler starts a transaction called "Process". Since the transaction could last from a couple of milliseconds up to tens of seconds, we'd like to send only the "problematic" transaction to sentry (the ones where the transaction duration is >= 1sec). Is this achievable in any way? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @LorenzoScebba, you could write your own Here's what this might look like:
You have to add the |
Beta Was this translation helpful? Give feedback.
Hello @LorenzoScebba, you could write your own
EventProcessor
and implement theSentryTransaction process(@NotNull SentryTransaction transaction, @NotNull Hint hint)
method. In it you could calculate the difference betweentransaction.getTimestamp()
andtransaction.getStartTimestamp()
, then returnnull
to drop the transaction.Here's what this might look like: