diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 14a17682..bd6cd95a 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -128,7 +128,7 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Remove optional packages
- run: composer remove doctrine/dbal doctrine/doctrine-bundle symfony/messenger symfony/twig-bundle symfony/cache --dev --no-update
+ run: composer remove doctrine/dbal doctrine/doctrine-bundle symfony/messenger symfony/twig-bundle symfony/cache symfony/http-client --dev --no-update
- name: Install dependencies
uses: ramsey/composer-install@v1
diff --git a/src/Resources/config/schema/sentry-1.0.xsd b/src/Resources/config/schema/sentry-1.0.xsd
index 79a6aac4..9240c5c6 100644
--- a/src/Resources/config/schema/sentry-1.0.xsd
+++ b/src/Resources/config/schema/sentry-1.0.xsd
@@ -91,6 +91,7 @@
+
@@ -117,4 +118,8 @@
+
+
+
+
diff --git a/tests/DependencyInjection/Fixtures/php/http_client_tracing_enabled.php b/tests/DependencyInjection/Fixtures/php/http_client_tracing_enabled.php
new file mode 100644
index 00000000..639e2f9a
--- /dev/null
+++ b/tests/DependencyInjection/Fixtures/php/http_client_tracing_enabled.php
@@ -0,0 +1,14 @@
+loadFromExtension('sentry', [
+ 'tracing' => [
+ 'http_client' => [
+ 'enabled' => true,
+ ],
+ ],
+]);
diff --git a/tests/DependencyInjection/Fixtures/xml/http_client_tracing_enabled.xml b/tests/DependencyInjection/Fixtures/xml/http_client_tracing_enabled.xml
new file mode 100644
index 00000000..cb0621ab
--- /dev/null
+++ b/tests/DependencyInjection/Fixtures/xml/http_client_tracing_enabled.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/tests/DependencyInjection/Fixtures/yml/http_client_tracing_enabled.yml b/tests/DependencyInjection/Fixtures/yml/http_client_tracing_enabled.yml
new file mode 100644
index 00000000..50d56ede
--- /dev/null
+++ b/tests/DependencyInjection/Fixtures/yml/http_client_tracing_enabled.yml
@@ -0,0 +1,4 @@
+sentry:
+ tracing:
+ http_client:
+ enabled: true
diff --git a/tests/DependencyInjection/SentryExtensionTest.php b/tests/DependencyInjection/SentryExtensionTest.php
index eaafea6d..e907e512 100644
--- a/tests/DependencyInjection/SentryExtensionTest.php
+++ b/tests/DependencyInjection/SentryExtensionTest.php
@@ -35,6 +35,7 @@
use Symfony\Component\DependencyInjection\ParameterBag\EnvPlaceholderParameterBag;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\ErrorHandler\Error\FatalError;
+use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent;
use Symfony\Component\Messenger\Event\WorkerMessageHandledEvent;
@@ -380,6 +381,18 @@ public function testTwigTracingExtensionIsConfiguredWhenTwigTracingIsEnabled():
$this->assertTrue($container->hasDefinition(TwigTracingExtension::class));
}
+ public function testHttpClientTracingExtensionIsConfiguredWhenHttpClientTracingIsEnabled(): void
+ {
+ if (!class_exists(HttpClient::class)) {
+ $this->expectException(\LogicException::class);
+ $this->expectExceptionMessage('Http client tracing support cannot be enabled because the symfony/http-client Composer package is not installed.');
+ }
+
+ $container = $this->createContainerFromFixture('http_client_tracing_enabled');
+
+ $this->assertTrue($container->getParameter('sentry.tracing.http_client.enabled'));
+ }
+
public function testTwigTracingExtensionIsRemovedWhenTwigTracingIsDisabled(): void
{
$container = $this->createContainerFromFixture('full');