Skip to content

Commit

Permalink
Support the http_connect_timeout and http_timeout options config …
Browse files Browse the repository at this point in the history
…options (#593)

Co-authored-by: Stefano Arlandini <[email protected]>
  • Loading branch information
matthew-gill and ste93cry committed May 30, 2022
1 parent 68a692c commit 75c1bc5
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased

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

## 4.2.10 (2022-05-17)

Expand Down
8 changes: 8 additions & 0 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ public function getConfigTreeBuilder(): TreeBuilder
->booleanNode('send_default_pii')->end()
->integerNode('max_value_length')->min(0)->end()
->scalarNode('http_proxy')->end()
->integerNode('http_connect_timeout')
->min(0)
->info('The maximum number of seconds to wait while trying to connect to a server. It works only when using the default transport.')
->end()
->integerNode('http_timeout')
->min(0)
->info('The maximum execution time for the request+response as a whole. It works only when using the default transport.')
->end()
->booleanNode('capture_silenced_errors')->end()
->enumNode('max_request_body_size')
->values([
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/config/schema/sentry-1.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
<xsd:attribute name="send-default-pii" type="xsd:boolean" />
<xsd:attribute name="max-value-length" type="xsd:integer" />
<xsd:attribute name="http-proxy" type="xsd:string" />
<xsd:attribute name="http-timeout" type="xsd:integer" />
<xsd:attribute name="http-connect-timeout" type="xsd:integer" />
<xsd:attribute name="capture-silenced-errors" type="xsd:boolean" />
<xsd:attribute name="max-request-body-size" type="max-request-body-size" />
</xsd:complexType>
Expand Down
2 changes: 2 additions & 0 deletions tests/DependencyInjection/Fixtures/php/full.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
'send_default_pii' => true,
'max_value_length' => 255,
'http_proxy' => 'proxy.example.com:8080',
'http_timeout' => 10,
'http_connect_timeout' => 15,
'capture_silenced_errors' => true,
'max_request_body_size' => 'none',
'class_serializers' => ['App\\FooClass' => 'App\\Sentry\\Serializer\\FooClassSerializer'],
Expand Down
2 changes: 2 additions & 0 deletions tests/DependencyInjection/Fixtures/xml/full.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
send-default-pii="true"
max-value-length="255"
http-proxy="proxy.example.com:8080"
http-timeout="10"
http-connect-timeout="15"
capture-silenced-errors="true"
max-request-body-size="none"
>
Expand Down
2 changes: 2 additions & 0 deletions tests/DependencyInjection/Fixtures/yml/full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ sentry:
send_default_pii: true
max_value_length: 255
http_proxy: proxy.example.com:8080
http_timeout: 10
http_connect_timeout: 15
capture_silenced_errors: true
max_request_body_size: 'none'
class_serializers:
Expand Down
2 changes: 2 additions & 0 deletions tests/DependencyInjection/SentryExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ public function testClientIsCreatedFromOptions(): void
'send_default_pii' => true,
'max_value_length' => 255,
'http_proxy' => 'proxy.example.com:8080',
'http_timeout' => 10,
'http_connect_timeout' => 15,
'capture_silenced_errors' => true,
'max_request_body_size' => 'none',
'class_serializers' => [
Expand Down

0 comments on commit 75c1bc5

Please sign in to comment.