Skip to content

Commit 75c1bc5

Browse files
Support the http_connect_timeout and http_timeout options config options (#593)
Co-authored-by: Stefano Arlandini <sarlandini@alice.it>
1 parent 68a692c commit 75c1bc5

File tree

7 files changed

+19
-0
lines changed

7 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Add `TracingDriverConnectionInterface::getNativeConnection()` method to get the original driver connection (#597)
6+
- Add `options.http_timeout` and `options.http_connect_timeout` configuration options (#593)
67

78
## 4.2.10 (2022-05-17)
89

src/DependencyInjection/Configuration.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ public function getConfigTreeBuilder(): TreeBuilder
116116
->booleanNode('send_default_pii')->end()
117117
->integerNode('max_value_length')->min(0)->end()
118118
->scalarNode('http_proxy')->end()
119+
->integerNode('http_connect_timeout')
120+
->min(0)
121+
->info('The maximum number of seconds to wait while trying to connect to a server. It works only when using the default transport.')
122+
->end()
123+
->integerNode('http_timeout')
124+
->min(0)
125+
->info('The maximum execution time for the request+response as a whole. It works only when using the default transport.')
126+
->end()
119127
->booleanNode('capture_silenced_errors')->end()
120128
->enumNode('max_request_body_size')
121129
->values([

src/Resources/config/schema/sentry-1.0.xsd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
<xsd:attribute name="send-default-pii" type="xsd:boolean" />
5050
<xsd:attribute name="max-value-length" type="xsd:integer" />
5151
<xsd:attribute name="http-proxy" type="xsd:string" />
52+
<xsd:attribute name="http-timeout" type="xsd:integer" />
53+
<xsd:attribute name="http-connect-timeout" type="xsd:integer" />
5254
<xsd:attribute name="capture-silenced-errors" type="xsd:boolean" />
5355
<xsd:attribute name="max-request-body-size" type="max-request-body-size" />
5456
</xsd:complexType>

tests/DependencyInjection/Fixtures/php/full.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
'send_default_pii' => true,
3737
'max_value_length' => 255,
3838
'http_proxy' => 'proxy.example.com:8080',
39+
'http_timeout' => 10,
40+
'http_connect_timeout' => 15,
3941
'capture_silenced_errors' => true,
4042
'max_request_body_size' => 'none',
4143
'class_serializers' => ['App\\FooClass' => 'App\\Sentry\\Serializer\\FooClassSerializer'],

tests/DependencyInjection/Fixtures/xml/full.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
send-default-pii="true"
3131
max-value-length="255"
3232
http-proxy="proxy.example.com:8080"
33+
http-timeout="10"
34+
http-connect-timeout="15"
3335
capture-silenced-errors="true"
3436
max-request-body-size="none"
3537
>

tests/DependencyInjection/Fixtures/yml/full.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ sentry:
3232
send_default_pii: true
3333
max_value_length: 255
3434
http_proxy: proxy.example.com:8080
35+
http_timeout: 10
36+
http_connect_timeout: 15
3537
capture_silenced_errors: true
3638
max_request_body_size: 'none'
3739
class_serializers:

tests/DependencyInjection/SentryExtensionTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ public function testClientIsCreatedFromOptions(): void
219219
'send_default_pii' => true,
220220
'max_value_length' => 255,
221221
'http_proxy' => 'proxy.example.com:8080',
222+
'http_timeout' => 10,
223+
'http_connect_timeout' => 15,
222224
'capture_silenced_errors' => true,
223225
'max_request_body_size' => 'none',
224226
'class_serializers' => [

0 commit comments

Comments
 (0)