Skip to content

Dropping a transaction based on its name and duration #2213

Answered by adinauer
LorenzoScebba asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @LorenzoScebba, you could write your own EventProcessor and implement the SentryTransaction process(@NotNull SentryTransaction transaction, @NotNull Hint hint) method. In it you could calculate the difference between transaction.getTimestamp() and transaction.getStartTimestamp(), then return null to drop the transaction.

Here's what this might look like:

public class MyEventProcessor implements EventProcessor {

  @Override
  public @Nullable SentryTransaction process(@NotNull SentryTransaction transaction, @NotNull Hint hint) {
    @Nullable Double end = transaction.getTimestamp();

    if (end != null && "Process".equals(transaction.getTransaction())) {
      @NotNull Double start…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@LorenzoScebba
Comment options

Answer selected by LorenzoScebba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants