You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/config.rst
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,10 @@ Optional settings
85
85
86
86
This option allows performing operations on the event before it is sent by ``Sentry.Client``. Accepts an anonymous function or a {module, function} tuple, and the event will be passed as the only argument.
87
87
88
+
.. describe:: after_send_event
89
+
90
+
This option allows performing arbitrary operations after attempting to send an event. Accepts an anonymous function or a {module, function} tuple, and the event will be passed as the first argument, and the result of sending the event will be passed as the second argument.
91
+
88
92
.. describe:: context_lines
89
93
90
94
The number of lines of source code before and after the line that caused the exception to be included. Defaults to ``3``.
Copy file name to clipboardExpand all lines: lib/sentry/client.ex
+36-5Lines changed: 36 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
defmoduleSentry.Clientdo
2
2
@behaviourSentry.HTTPClient
3
3
4
-
@moduledoc"""
4
+
@moduledoc~S"""
5
5
This module is the default client for sending an event to Sentry via HTTP.
6
6
7
7
It makes use of `Task.Supervisor` to allow sending tasks synchronously or asynchronously, and defaulting to asynchronous. See `Sentry.Client.send_event/2` for more information.
@@ -12,12 +12,25 @@ defmodule Sentry.Client do
12
12
it is sent. Accepts an anonymous function or a {module, function} tuple, and
13
13
the event will be passed as the only argument.
14
14
15
+
* `:after_send_event` - callback that is called after attempting to send an event.
16
+
Accepts an anonymous function or a {module, function} tuple. The result of the HTTP call as well as the event will be passed as arguments.
17
+
The return value of the callback is not returned.
18
+
15
19
Example configuration of putting Logger metadata in the extra context:
0 commit comments