-
-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a Sentry event for failed HTTP requests #2217
Comments
Applies to We should think about what stacktrace (if any) belongs with the error. |
This would be part of our |
I'm looking into this now and in particular the docs regarding FailedRequestTargets. We already have the TracePropagationTarget class, which appears to do exactly what we want. About the only thing wrong with it is the name. If it wasn't public I'd suggest we simply rename it to Two alternatives I can think of then (and there may be more):
Are there any strong opinions about which approach to take? I was leaning towards option 1 personally... but it may have drawbacks I haven't considered. |
Agreed, the name is too specific. Even |
To retain compatibility, we can create a new type for this, move most of the functionality, and make it the base type of the existing one. In the next major, we can remove the current one and replace it with the new one. (Until then, we'll just leave a comment. We don't need to obsolete it.) |
|
So I think I'm in the home stretch on this. All I have to do now is actually send the event data! I think I'll be able to take a lot of inspiration from SentryOkHttpInterceptor.captureEvent in the Java SDK. I have a few questions though. The Java SDK contains a I see the .NET SDK includes a I'm trying to work out, in .NET, how we should be recording all the appropriate information. My best guess is:
I suspect (but haven't gone all the way down the rabbit hole to verify) that the Is that the general flow? Maybe there's a good example of how exception events are generated somewhere else in the .NET SDK code that would be good to refer to? |
Correct.
We don't need to create any custom exception here, because .NET already has try
{
response.EnsureSuccessStatusCode();
}
catch (HttpRequestException exception)
{
exception.SetSentryMechanism(MechanismType);
_hub.CaptureException(exception);
}
Correct. We don't need to do anything special here. Just capture the exception and let the existing SDK components do the rest. |
I'll add some comments inline the draft PR also. Thanks. 😃 |
Problem Statement
Failed HTTP requests don't result in Sentry events
Solution Brainstorm
Main issue with description
The text was updated successfully, but these errors were encountered: