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:
128
128
run : echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
129
129
130
130
- 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
132
132
133
133
- name : Install dependencies
134
134
uses : ramsey/composer-install@v1
Original file line number Diff line number Diff line change 91
91
<xsd : element name =" twig" type =" tracing-twig" minOccurs =" 0" maxOccurs =" 1" />
92
92
<xsd : element name =" cache" type =" tracing-cache" minOccurs =" 0" maxOccurs =" 1" />
93
93
<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" />
94
95
</xsd : choice >
95
96
96
97
<xsd : attribute name =" enabled" type =" xsd:boolean" default =" true" />
117
118
<xsd : element name =" excluded-command" type =" xsd:string" minOccurs =" 0" maxOccurs =" unbounded" />
118
119
</xsd : sequence >
119
120
</xsd : complexType >
121
+
122
+ <xsd : complexType name =" tracing-http-client" >
123
+ <xsd : attribute name =" enabled" type =" xsd:boolean" />
124
+ </xsd : complexType >
120
125
</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 35
35
use Symfony \Component \DependencyInjection \ParameterBag \EnvPlaceholderParameterBag ;
36
36
use Symfony \Component \DependencyInjection \Reference ;
37
37
use Symfony \Component \ErrorHandler \Error \FatalError ;
38
+ use Symfony \Component \HttpClient \HttpClient ;
38
39
use Symfony \Component \HttpKernel \KernelEvents ;
39
40
use Symfony \Component \Messenger \Event \WorkerMessageFailedEvent ;
40
41
use Symfony \Component \Messenger \Event \WorkerMessageHandledEvent ;
@@ -380,6 +381,18 @@ public function testTwigTracingExtensionIsConfiguredWhenTwigTracingIsEnabled():
380
381
$ this ->assertTrue ($ container ->hasDefinition (TwigTracingExtension::class));
381
382
}
382
383
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
+
383
396
public function testTwigTracingExtensionIsRemovedWhenTwigTracingIsDisabled (): void
384
397
{
385
398
$ container = $ this ->createContainerFromFixture ('full ' );
You can’t perform that action at this time.
0 commit comments