Add `Hint` support to beforeSend and Event processors
See original GitHub issueHi, Sentry is great!
I am however missing a way to add an attachment to an outgoing event in the BeforeSend
callback.
For example:
using var host = Host.CreateDefaultBuilder()
.ConfigureLogging((context, builder) =>
{
builder.AddSentry(options =>
{
options.BeforeSend = sentryEvent =>
{
sentryEvent.AddBreadcrumb("Hello"); // I can do this
sentryEvent.AddAttachment("Foo.txt"); // But I cannot do this
return sentryEvent;
};
};
})
.Build();
Am I missing something, or this is a missing feature?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Event Processors for Browser JavaScript
Like beforeSend and beforeSendTransaction , event processors are passed two arguments, the event itself and a hint object containing extra metadata.
Read more >Filtering for Browser JavaScript
The beforeSend callback is passed both the event and a second argument, hint , that holds one or more hints. Typically a hint...
Read more >AJAX event for when the server receives the request
Something like onSend is the beforeSend because it executes before sending, and while are you sending, why you would fire a event?
Read more >Jquery Ajax beforeSend and success,error & complete
The loading class I am adding to the placeholder before sending is working for the first ajax call. However soon after the first...
Read more >Unified API - Sentry Developer Documentation
We want a unified language/wording of all SDK APIs to aid support and documentation as well as ... event processors: Callbacks that run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Because we’ve currently implemented
BeforeSend
as a property that accepts a delegate function, there’s no clean way to add aHint
parameter to the function without making a breaking change that would require a major version bump. Methods are overloadable, but properties are not.I’d like to handle this as follows:
The usage would then change from:
To the following:
… or when hints are desired:
Note, this also applies to
BeforeBreadcrumb
, and our docs already (incorrectly) state that hints are supported.https://docs.sentry.io/platforms/dotnet/configuration/options/#before-breadcrumb