Skip to content

Commit

Permalink
feat(integrations): Add support for HTTP Client baggage propagation (
Browse files Browse the repository at this point in the history
  • Loading branch information
DAcodedBEAT committed Nov 19, 2022
1 parent 70dcc0b commit 072c454
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@
- Add support for tracing of the Symfony HTTP client requests (#606)
- Support logging the impersonator user, if any (#647)
- ref: Use constant for the SDK version (#662)
- Add support for HTTP Client baggage propagation (#663)

## 4.3.1 (2022-10-10)

Expand Down
5 changes: 5 additions & 0 deletions src/DependencyInjection/Configuration.php
Expand Up @@ -48,6 +48,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->arrayNode('options')
->addDefaultsIfNotSet()
->fixXmlConfig('integration')
->fixXmlConfig('trace_propagation_target')
->fixXmlConfig('tag')
->fixXmlConfig('class_serializer')
->fixXmlConfig('prefix', 'prefixes')
Expand All @@ -72,6 +73,10 @@ public function getConfigTreeBuilder(): TreeBuilder
->info('The sampling factor to apply to transactions. A value of 0 will deny sending any transaction, and a value of 1 will send all transactions.')
->end()
->scalarNode('traces_sampler')->end()
->arrayNode('trace_propagation_targets')
->scalarPrototype()->end()
->beforeNormalization()->castToArray()->end()
->end()
->booleanNode('attach_stacktrace')->end()
->integerNode('context_lines')->min(0)->end()
->booleanNode('enable_compression')->end()
Expand Down
1 change: 1 addition & 0 deletions src/Resources/config/schema/sentry-1.0.xsd
Expand Up @@ -23,6 +23,7 @@
<xsd:complexType name="options">
<xsd:sequence>
<xsd:element name="integration" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="trace-propagation-target" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="prefix" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="tag" type="tag" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="in-app-exclude" type="xsd:string" minOccurs="0" maxOccurs="unbounded" />
Expand Down
1 change: 1 addition & 0 deletions tests/DependencyInjection/ConfigurationTest.php
Expand Up @@ -26,6 +26,7 @@ public function testProcessConfigurationWithDefaultConfiguration(): void
'options' => [
'integrations' => [],
'prefixes' => array_merge(['%kernel.project_dir%'], array_filter(explode(\PATH_SEPARATOR, get_include_path() ?: ''))),
'trace_propagation_targets' => [],
'environment' => '%kernel.environment%',
'release' => PrettyVersions::getRootPackageVersion()->getPrettyVersion(),
'tags' => [],
Expand Down
1 change: 1 addition & 0 deletions tests/DependencyInjection/Fixtures/php/full.php
Expand Up @@ -17,6 +17,7 @@
'sample_rate' => 1,
'traces_sample_rate' => 1,
'traces_sampler' => 'App\\Sentry\\Tracing\\TracesSampler',
'trace_propagation_targets' => ['website.invalid'],
'attach_stacktrace' => true,
'context_lines' => 0,
'enable_compression' => true,
Expand Down
1 change: 1 addition & 0 deletions tests/DependencyInjection/Fixtures/xml/full.xml
Expand Up @@ -36,6 +36,7 @@
max-request-body-size="none"
>
<sentry:integration>App\Sentry\Integration\FooIntegration</sentry:integration>
<sentry:trace-propagation-target>website.invalid</sentry:trace-propagation-target>
<sentry:prefix>%kernel.project_dir%</sentry:prefix>
<sentry:tag name="context">development</sentry:tag>
<sentry:in-app-exclude>%kernel.cache_dir%</sentry:in-app-exclude>
Expand Down
2 changes: 2 additions & 0 deletions tests/DependencyInjection/Fixtures/yml/full.yml
Expand Up @@ -12,6 +12,8 @@ sentry:
sample_rate: 1
traces_sample_rate: 1
traces_sampler: App\Sentry\Tracing\TracesSampler
trace_propagation_targets:
- 'website.invalid'
attach_stacktrace: true
context_lines: 0
enable_compression: true
Expand Down
1 change: 1 addition & 0 deletions tests/DependencyInjection/SentryExtensionTest.php
Expand Up @@ -202,6 +202,7 @@ public function testClientIsCreatedFromOptions(): void
'sample_rate' => 1,
'traces_sample_rate' => 1,
'traces_sampler' => new Reference('App\\Sentry\\Tracing\\TracesSampler'),
'trace_propagation_targets' => ['website.invalid'],
'attach_stacktrace' => true,
'context_lines' => 0,
'enable_compression' => true,
Expand Down

0 comments on commit 072c454

Please sign in to comment.