Why can't I stop on this breakpoint in a BeforeSend callback? #2110
-
|
I am trying to a prefix to all sentry transaction names using the BeforeSend callback but it is not working. I am doing something similar in the javascript sdk and it works fine. Am I doing something wrong? In my code I can always hit the first breakpoint be never the second one. |
Beta Was this translation helpful? Give feedback.
Answered by
mattjohnsonpint
Jan 12, 2023
Replies: 1 comment
-
|
Only error events will call 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(namePrefix)); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mattjohnsonpint
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Only error events will call
BeforeSend. You would needBeforeSendTransaction, which we have on our backlog with #2077.You could try using a transaction processor instead, such as:
You'd add it to the options with: