Skip to content

Commit

Permalink
[TASK] Use TYPO3 HTTP configuration in sentry client
Browse files Browse the repository at this point in the history
With version 4 of the Sentry SDK, Sentry now ships a simple
and custom HTTP client which is based on curl. Using Guzzle
as HTTP client does not seem possible, since Sentry SDK
does use `php-http/discovery` anymore.

Basic HTTP configuration in $GLOBALS['TYPO3_CONF_VARS']['HTTP']
should be reflected to the Sentry HTTP client.

This change reflects the following TYPO3 HTTP options to
the Sentry HTTP client:

* verify
* http_timeout
* connect_timeout

Closes #103
  • Loading branch information
derhansen committed Apr 20, 2024
1 parent b18468f commit 2ac0697
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Classes/Service/SentryService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public static function inititalize(): bool
'environment' => ConfigurationService::getEnvironment(),
'in_app_include' => [Environment::getExtensionsPath()],
'http_proxy' => $GLOBALS['TYPO3_CONF_VARS']['HTTP']['proxy'] ?? null,
'http_ssl_verify_peer' => $GLOBALS['TYPO3_CONF_VARS']['HTTP']['verify'] ?? true,
'http_timeout' => $GLOBALS['TYPO3_CONF_VARS']['HTTP']['http_timeout'] ?? 5,
'http_connect_timeout' => $GLOBALS['TYPO3_CONF_VARS']['HTTP']['connect_timeout'] ?? 2,
'attach_stacktrace' => true,
'before_send' => function (Event $event): Event {
return SentryLogWriter::cleanupStacktrace($event);
Expand Down

0 comments on commit 2ac0697

Please sign in to comment.