11defmodule Sentry.Options do
22 @ moduledoc false
33
4- @ send_event_opts_schema_as_keyword [
4+ @ common_opts_schema_as_keyword [
55 result: [
66 type: { :in , [ :sync , :none ] } ,
77 doc: """
@@ -15,29 +15,6 @@ defmodule Sentry.Options do
1515 call ends up being successful or not.
1616 """
1717 ] ,
18- sample_rate: [
19- type: :float ,
20- doc: """
21- Same as the global `:sample_rate` configuration, but applied only to
22- this call. See the module documentation. *Available since v10.0.0*.
23- """
24- ] ,
25- before_send: [
26- type: { :or , [ { :fun , 1 } , { :tuple , [ :atom , :atom ] } ] } ,
27- type_doc: "`t:before_send_event_callback/0`" ,
28- doc: """
29- Same as the global `:before_send` configuration, but
30- applied only to this call. See the module documentation. *Available since v10.0.0*.
31- """
32- ] ,
33- after_send_event: [
34- type: { :or , [ { :fun , 2 } , { :tuple , [ :atom , :atom ] } ] } ,
35- type_doc: "`t:after_send_event_callback/0`" ,
36- doc: """
37- Same as the global `:after_send_event` configuration, but
38- applied only to this call. See the module documentation. *Available since v10.0.0*.
39- """
40- ] ,
4118 client: [
4219 type: :atom ,
4320 type_doc: "`t:module/0`" ,
@@ -54,6 +31,32 @@ defmodule Sentry.Options do
5431 ]
5532 ]
5633
34+ @ send_event_opts_schema_as_keyword Keyword . merge ( @ common_opts_schema_as_keyword ,
35+ sample_rate: [
36+ type: :float ,
37+ doc: """
38+ Same as the global `:sample_rate` configuration, but applied only to
39+ this call. See the module documentation. *Available since v10.0.0*.
40+ """
41+ ] ,
42+ before_send: [
43+ type: { :or , [ { :fun , 1 } , { :tuple , [ :atom , :atom ] } ] } ,
44+ type_doc: "`t:before_send_event_callback/0`" ,
45+ doc: """
46+ Same as the global `:before_send` configuration, but
47+ applied only to this call. See the module documentation. *Available since v10.0.0*.
48+ """
49+ ] ,
50+ after_send_event: [
51+ type: { :or , [ { :fun , 2 } , { :tuple , [ :atom , :atom ] } ] } ,
52+ type_doc: "`t:after_send_event_callback/0`" ,
53+ doc: """
54+ Same as the global `:after_send_event` configuration, but
55+ applied only to this call. See the module documentation. *Available since v10.0.0*.
56+ """
57+ ]
58+ )
59+
5760 @ create_event_opts_schema_as_keyword [
5861 exception: [
5962 type: { :custom , Sentry.Event , :__validate_exception__ , [ :exception ] } ,
@@ -191,6 +194,10 @@ defmodule Sentry.Options do
191194
192195 @ create_event_opts_schema NimbleOptions . new! ( @ create_event_opts_schema_as_keyword )
193196
197+ @ send_transaction_opts_schema_as_keyword Keyword . merge ( @ common_opts_schema_as_keyword , [ ] )
198+
199+ @ send_transaction_opts_schema NimbleOptions . new! ( @ send_transaction_opts_schema_as_keyword )
200+
194201 @ spec send_event_schema ( ) :: NimbleOptions . t ( )
195202 def send_event_schema do
196203 @ send_event_opts_schema
@@ -206,6 +213,11 @@ defmodule Sentry.Options do
206213 @ create_event_opts_schema
207214 end
208215
216+ @ spec send_transaction_schema ( ) :: NimbleOptions . t ( )
217+ def send_transaction_schema do
218+ @ send_transaction_opts_schema
219+ end
220+
209221 @ spec docs_for ( atom ( ) ) :: String . t ( )
210222 def docs_for ( type )
211223
0 commit comments