@@ -194,10 +194,7 @@ public function setTracesSampleRate(?float $sampleRate): self
194
194
195
195
public function getProfilesSampleRate (): ?float
196
196
{
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 ' ];
201
198
}
202
199
203
200
public function setProfilesSampleRate (?float $ sampleRate ): self
@@ -209,6 +206,34 @@ public function setProfilesSampleRate(?float $sampleRate): self
209
206
return $ this ;
210
207
}
211
208
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 ' ] ?? null ;
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
+
212
237
/**
213
238
* Gets whether tracing is enabled or not. The feature is enabled when at
214
239
* least one of the `traces_sample_rate` and `traces_sampler` options is
@@ -1223,6 +1248,8 @@ private function configureOptions(OptionsResolver $resolver): void
1223
1248
'traces_sample_rate ' => null ,
1224
1249
'traces_sampler ' => null ,
1225
1250
'profiles_sample_rate ' => null ,
1251
+ 'profile_session_sample_rate ' => null ,
1252
+ 'profile_lifecycle ' => null ,
1226
1253
'attach_stacktrace ' => false ,
1227
1254
/**
1228
1255
* @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
1293
1320
$ resolver ->setAllowedTypes ('traces_sample_rate ' , ['null ' , 'int ' , 'float ' ]);
1294
1321
$ resolver ->setAllowedTypes ('traces_sampler ' , ['null ' , 'callable ' ]);
1295
1322
$ 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 ' ]);
1296
1325
$ resolver ->setAllowedTypes ('attach_stacktrace ' , 'bool ' );
1297
1326
$ resolver ->setAllowedTypes ('attach_metric_code_locations ' , 'bool ' );
1298
1327
$ resolver ->setAllowedTypes ('context_lines ' , ['null ' , 'int ' ]);
@@ -1335,6 +1364,7 @@ private function configureOptions(OptionsResolver $resolver): void
1335
1364
$ resolver ->setAllowedTypes ('class_serializers ' , 'array ' );
1336
1365
1337
1366
$ resolver ->setAllowedValues ('max_request_body_size ' , ['none ' , 'never ' , 'small ' , 'medium ' , 'always ' ]);
1367
+ $ resolver ->setAllowedValues ('profile_lifecycle ' , [null , 'trace ' , 'manual ' ]);
1338
1368
$ resolver ->setAllowedValues ('dsn ' , \Closure::fromCallable ([$ this , 'validateDsnOption ' ]));
1339
1369
$ resolver ->setAllowedValues ('max_breadcrumbs ' , \Closure::fromCallable ([$ this , 'validateMaxBreadcrumbsOptions ' ]));
1340
1370
$ resolver ->setAllowedValues ('class_serializers ' , \Closure::fromCallable ([$ this , 'validateClassSerializersOption ' ]));
0 commit comments