@@ -316,7 +316,7 @@ defmodule Sentry.Config do
316316 The maximum number of attempts to send an event to Sentry.
317317 """
318318 ] ,
319- finch_opts : [
319+ finch_pool_opts : [
320320 type: :keyword_list ,
321321 default: [ size: 50 , conn_max_idle_time: 5000 ] ,
322322 doc: """
@@ -326,32 +326,48 @@ defmodule Sentry.Config do
326326 for available options.
327327 """
328328 ] ,
329- hackney_opts : [
329+ finch_request_opts : [
330330 type: :keyword_list ,
331- default: [ pool: :sentry_pool ] ,
331+ default: [ receive_timeout: 50 ] ,
332332 doc: """
333- Options to be passed to `hackney`. Only
334- applied if `:client` is set to `Sentry.HackneyClient`.
335- """
336- ] ,
337- hackney_pool_timeout: [
338- type: :timeout ,
339- default: 5000 ,
340- doc: """
341- The maximum time to wait for a
342- connection to become available. Only applied if `:client` is set to
343- `Sentry.HackneyClient`.
333+ Request options to be passed to `Finch.request/4`. These options control
334+ individual request behavior. Only applied if `:client` is set to
335+ `Sentry.FinchClient`. See [Finch documentation](https://hexdocs.pm/finch/Finch.html#request/4)
336+ for available options.
344337 """
345338 ] ,
346- hackney_pool_max_connections: [
347- type: :pos_integer ,
348- default: 50 ,
349- doc: """
350- The maximum number of
351- connections to keep in the pool. Only applied if `:client` is set to
352- `Sentry.HackneyClient`.
353- """
354- ]
339+ hackney_opts:
340+ [
341+ type: :keyword_list ,
342+ default: [ pool: :sentry_pool ] ,
343+ doc: """
344+ Options to be passed to `hackney`. Only
345+ applied if `:client` is set to `Sentry.HackneyClient`.
346+ """
347+ ] ++
348+ if ( Mix . env ( ) == :test , do: [ ] , else: [ deprecated: "Use Finch instead as default client." ] ) ,
349+ hackney_pool_timeout:
350+ [
351+ type: :timeout ,
352+ default: 5000 ,
353+ doc: """
354+ The maximum time to wait for a
355+ connection to become available. Only applied if `:client` is set to
356+ `Sentry.HackneyClient`.
357+ """
358+ ] ++
359+ if ( Mix . env ( ) == :test , do: [ ] , else: [ deprecated: "Use Finch instead as default client." ] ) ,
360+ hackney_pool_max_connections:
361+ [
362+ type: :pos_integer ,
363+ default: 50 ,
364+ doc: """
365+ The maximum number of
366+ connections to keep in the pool. Only applied if `:client` is set to
367+ `Sentry.HackneyClient`.
368+ """
369+ ] ++
370+ if ( Mix . env ( ) == :test , do: [ ] , else: [ deprecated: "Use Finch instead as default client." ] )
355371 ]
356372
357373 source_code_context_opts_schema = [
@@ -617,8 +633,11 @@ defmodule Sentry.Config do
617633 @ spec sample_rate ( ) :: float ( )
618634 def sample_rate , do: fetch! ( :sample_rate )
619635
620- @ spec finch_opts ( ) :: keyword ( )
621- def finch_opts , do: fetch! ( :finch_opts )
636+ @ spec finch_pool_opts ( ) :: keyword ( )
637+ def finch_pool_opts , do: fetch! ( :finch_pool_opts )
638+
639+ @ spec finch_request_opts ( ) :: keyword ( )
640+ def finch_request_opts , do: fetch! ( :finch_request_opts )
622641
623642 @ spec hackney_opts ( ) :: keyword ( )
624643 def hackney_opts , do: fetch! ( :hackney_opts )
0 commit comments