File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
tests/integration/instrumentation/Symfony/OtelSdkBundle/DependencyInjection Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,14 @@ public function testSamplers(): void
102102 {
103103 $ this ->loadTestData ('sampler ' );
104104
105+ $ sampler = $ this ->getDefinitionByClass (SDK \Trace \TracerProvider::class)
106+ ->getArgument (1 );
107+
108+ $ this ->assertReference (
109+ SDK \Trace \Sampler \ParentBased::class,
110+ $ sampler
111+ );
112+
105113 $ parent = $ this ->getDefinitionByClass (SDK \Trace \Sampler \ParentBased::class);
106114 $ arguments = $ parent ->getArguments ();
107115
@@ -132,6 +140,34 @@ public function testSamplers(): void
132140 );
133141 }
134142
143+ public function testAlwaysOffRootSamplerRegression (): void
144+ {
145+ $ data = $ this ->retrieveTestData ('simple ' );
146+ $ data ['trace ' ]['sampler ' ] = 'always_off ' ;
147+
148+ $ this ->load (
149+ self ::wrapConfig (
150+ $ data
151+ )
152+ );
153+
154+ $ sampler = $ this ->getDefinitionByClass (SDK \Trace \TracerProvider::class)
155+ ->getArgument (1 );
156+
157+ $ this ->assertReference (
158+ SDK \Trace \Sampler \ParentBased::class,
159+ $ sampler
160+ );
161+
162+ $ parent = $ this ->getDefinitionByClass (SDK \Trace \Sampler \ParentBased::class);
163+ $ arguments = $ parent ->getArguments ();
164+
165+ $ this ->assertReference (
166+ SDK \Trace \Sampler \AlwaysOffSampler::class,
167+ $ arguments [0 ]
168+ );
169+ }
170+
135171 /**
136172 * @throws Exception
137173 */
You can’t perform that action at this time.
0 commit comments