Skip to content

Why can't I stop on this breakpoint in a BeforeSend callback? #2110

Answered by mattjohnsonpint
fpw23 asked this question in Q&A
Discussion options

You must be logged in to vote

Only error events will call BeforeSend. You would need BeforeSendTransaction, which we have on our backlog with #2077.

You could try using a transaction processor instead, such as:

public class PrefixTransactionNameProcessor : ISentryTransactionProcessor
{
    private readonly string _namePrefix;

    public PrefixTransactionNameProcessor(string namePrefix)
    {
        _namePrefix = namePrefix;
    }

    public Transaction Process(Transaction transaction)
    {
        ((IEventLike)transaction).TransactionName = $"{_namePrefix} - {transaction.Name}";
        return transaction;
    }
}

You'd add it to the options with:

o.AddTransactionProcessor(new PrefixTransactionNameProcessor(namePr…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mattjohnsonpint
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