php-sdk icon indicating copy to clipboard operation
php-sdk copied to clipboard

Handmade profil triggered by the SDK are enlisted by default.

Open thomasdiluccio opened this issue 3 years ago • 2 comments

Profiles triggered by custom code are enlisted by default. They cannot be unlisted. Tested with the v1.23.0 and the v1.25.0.

$this->blackfireClient = new Client();
$this->config = new Configuration();

or

$this->blackfireClient = new Client();
$this->config = (new Configuration())
    ->setMetadata('skip_timeline', 'true')
;

both lead to enlisted results.

thomasdiluccio avatar Mar 12 '21 09:03 thomasdiluccio

I am able to reproduce with the following script:

require __DIR__.'/vendor/autoload.php';

$blackfireClient = new \Blackfire\Client();
$config = new \Blackfire\Profile\Configuration();
$config->setTitle('Test SDK issue');
$probe = $blackfireClient->createProbe($config);

sleep(2);
echo "Hello world!";

echo $blackfireClient->endProbe($probe)->getUrl()."\n";

The profile is expected not to be listed by default, but it actually is.

lolautruche avatar Mar 18 '21 10:03 lolautruche

However, when I add skip_timeline to true, the profile is first enlisted, but disappears a few seconds later (I am guessing that a consumer updates the profile afterwards):

<?php

require __DIR__.'/vendor/autoload.php';

$blackfireClient = new \Blackfire\Client();
$config = new \Blackfire\Profile\Configuration();
$config->setTitle('Test SDK issue');
$config->setMetadata('issue', 'https://github.com/blackfireio/php-sdk/issues/53');
$config->setMetadata('skip_timeline', 'true');
$probe = $blackfireClient->createProbe($config);

sleep(2);
echo "Hello world!\n";

echo $blackfireClient->endProbe($probe)->getUrl()."\n";

lolautruche avatar Mar 18 '21 10:03 lolautruche