File tree Expand file tree Collapse file tree 6 files changed +51
-1
lines changed
src/Resources/config/schema
tests/DependencyInjection Expand file tree Collapse file tree 6 files changed +51
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ jobs:
128128 run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
129129
130130 - name : Remove optional packages
131- run : composer remove doctrine/dbal doctrine/doctrine-bundle symfony/messenger symfony/twig-bundle symfony/cache --dev --no-update
131+ run : composer remove doctrine/dbal doctrine/doctrine-bundle symfony/messenger symfony/twig-bundle symfony/cache symfony/http-client --dev --no-update
132132
133133 - name : Install dependencies
134134 uses : ramsey/composer-install@v1
Original file line number Diff line number Diff line change 9191 <xsd : element name =" twig" type =" tracing-twig" minOccurs =" 0" maxOccurs =" 1" />
9292 <xsd : element name =" cache" type =" tracing-cache" minOccurs =" 0" maxOccurs =" 1" />
9393 <xsd : element name =" console" type =" tracing-console" minOccurs =" 0" maxOccurs =" 1" />
94+ <xsd : element name =" http-client" type =" tracing-http-client" minOccurs =" 0" maxOccurs =" 1" />
9495 </xsd : choice >
9596
9697 <xsd : attribute name =" enabled" type =" xsd:boolean" default =" true" />
117118 <xsd : element name =" excluded-command" type =" xsd:string" minOccurs =" 0" maxOccurs =" unbounded" />
118119 </xsd : sequence >
119120 </xsd : complexType >
121+
122+ <xsd : complexType name =" tracing-http-client" >
123+ <xsd : attribute name =" enabled" type =" xsd:boolean" />
124+ </xsd : complexType >
120125</xsd : schema >
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use Symfony \Component \DependencyInjection \ContainerBuilder ;
6+
7+ /** @var ContainerBuilder $container */
8+ $ container ->loadFromExtension ('sentry ' , [
9+ 'tracing ' => [
10+ 'http_client ' => [
11+ 'enabled ' => true ,
12+ ],
13+ ],
14+ ]);
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+
3+ <container xmlns =" http://symfony.com/schema/dic/services"
4+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5+ xmlns : sentry =" https://sentry.io/schema/dic/sentry-symfony"
6+ xsi : schemaLocation =" http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
7+ https://sentry.io/schema/dic/sentry-symfony https://sentry.io/schema/dic/sentry-symfony/sentry-1.0.xsd" >
8+
9+ <sentry : config >
10+ <sentry : tracing >
11+ <sentry : http-client enabled =" true" />
12+ </sentry : tracing >
13+ </sentry : config >
14+ </container >
Original file line number Diff line number Diff line change 1+ sentry :
2+ tracing :
3+ http_client :
4+ enabled : true
Original file line number Diff line number Diff line change 3535use Symfony \Component \DependencyInjection \ParameterBag \EnvPlaceholderParameterBag ;
3636use Symfony \Component \DependencyInjection \Reference ;
3737use Symfony \Component \ErrorHandler \Error \FatalError ;
38+ use Symfony \Component \HttpClient \HttpClient ;
3839use Symfony \Component \HttpKernel \KernelEvents ;
3940use Symfony \Component \Messenger \Event \WorkerMessageFailedEvent ;
4041use Symfony \Component \Messenger \Event \WorkerMessageHandledEvent ;
@@ -380,6 +381,18 @@ public function testTwigTracingExtensionIsConfiguredWhenTwigTracingIsEnabled():
380381 $ this ->assertTrue ($ container ->hasDefinition (TwigTracingExtension::class));
381382 }
382383
384+ public function testHttpClientTracingExtensionIsConfiguredWhenHttpClientTracingIsEnabled (): void
385+ {
386+ if (!class_exists (HttpClient::class)) {
387+ $ this ->expectException (\LogicException::class);
388+ $ this ->expectExceptionMessage ('Http client tracing support cannot be enabled because the symfony/http-client Composer package is not installed. ' );
389+ }
390+
391+ $ container = $ this ->createContainerFromFixture ('http_client_tracing_enabled ' );
392+
393+ $ this ->assertTrue ($ container ->getParameter ('sentry.tracing.http_client.enabled ' ));
394+ }
395+
383396 public function testTwigTracingExtensionIsRemovedWhenTwigTracingIsDisabled (): void
384397 {
385398 $ container = $ this ->createContainerFromFixture ('full ' );
You can’t perform that action at this time.
0 commit comments