@@ -194,10 +194,7 @@ public function setTracesSampleRate(?float $sampleRate): self
194194
195195 public function getProfilesSampleRate (): ?float
196196 {
197- /** @var int|float|null $value */
198- $ value = $ this ->options ['profiles_sample_rate ' ] ?? null ;
199-
200- return $ value ?? null ;
197+ return $ this ->options ['profiles_sample_rate ' ];
201198 }
202199
203200 public function setProfilesSampleRate (?float $ sampleRate ): self
@@ -209,6 +206,34 @@ public function setProfilesSampleRate(?float $sampleRate): self
209206 return $ this ;
210207 }
211208
209+ public function getProfileSessionSampleRate (): ?float
210+ {
211+ return $ this ->options ['profile_session_sample_rate ' ];
212+ }
213+
214+ public function setProfileSessionSampleRate (?float $ sampleRate ): self
215+ {
216+ $ options = array_merge ($ this ->options , ['profile_session_sample_rate ' => $ sampleRate ]);
217+
218+ $ this ->options = $ this ->resolver ->resolve ($ options );
219+
220+ return $ this ;
221+ }
222+
223+ public function getProfileLifecycle (): ?string
224+ {
225+ return $ this ->options ['profile_lifecycle ' ];
226+ }
227+
228+ public function setProfileLifecycle (?string $ lifecycle ): self
229+ {
230+ $ options = array_merge ($ this ->options , ['profile_lifecycle ' => $ lifecycle ]);
231+
232+ $ this ->options = $ this ->resolver ->resolve ($ options );
233+
234+ return $ this ;
235+ }
236+
212237 /**
213238 * Gets whether tracing is enabled or not. The feature is enabled when at
214239 * least one of the `traces_sample_rate` and `traces_sampler` options is
@@ -1223,6 +1248,8 @@ private function configureOptions(OptionsResolver $resolver): void
12231248 'traces_sample_rate ' => null ,
12241249 'traces_sampler ' => null ,
12251250 'profiles_sample_rate ' => null ,
1251+ 'profile_session_sample_rate ' => null ,
1252+ 'profile_lifecycle ' => null ,
12261253 'attach_stacktrace ' => false ,
12271254 /**
12281255 * @deprecated Metrics are no longer supported. Metrics API is a no-op and will be removed in 5.x.
@@ -1293,6 +1320,8 @@ private function configureOptions(OptionsResolver $resolver): void
12931320 $ resolver ->setAllowedTypes ('traces_sample_rate ' , ['null ' , 'int ' , 'float ' ]);
12941321 $ resolver ->setAllowedTypes ('traces_sampler ' , ['null ' , 'callable ' ]);
12951322 $ resolver ->setAllowedTypes ('profiles_sample_rate ' , ['null ' , 'int ' , 'float ' ]);
1323+ $ resolver ->setAllowedTypes ('profile_session_sample_rate ' , ['null ' , 'int ' , 'float ' ]);
1324+ $ resolver ->setAllowedTypes ('profile_lifecycle ' , ['null ' , 'string ' ]);
12961325 $ resolver ->setAllowedTypes ('attach_stacktrace ' , 'bool ' );
12971326 $ resolver ->setAllowedTypes ('attach_metric_code_locations ' , 'bool ' );
12981327 $ resolver ->setAllowedTypes ('context_lines ' , ['null ' , 'int ' ]);
@@ -1335,6 +1364,7 @@ private function configureOptions(OptionsResolver $resolver): void
13351364 $ resolver ->setAllowedTypes ('class_serializers ' , 'array ' );
13361365
13371366 $ resolver ->setAllowedValues ('max_request_body_size ' , ['none ' , 'never ' , 'small ' , 'medium ' , 'always ' ]);
1367+ $ resolver ->setAllowedValues ('profile_lifecycle ' , [null , 'trace ' , 'manual ' ]);
13381368 $ resolver ->setAllowedValues ('dsn ' , \Closure::fromCallable ([$ this , 'validateDsnOption ' ]));
13391369 $ resolver ->setAllowedValues ('max_breadcrumbs ' , \Closure::fromCallable ([$ this , 'validateMaxBreadcrumbsOptions ' ]));
13401370 $ resolver ->setAllowedValues ('class_serializers ' , \Closure::fromCallable ([$ this , 'validateClassSerializersOption ' ]));
0 commit comments