philkra / elastic-apm-laravel

Elastic APM Client for Laravel
94 stars 50 forks source link

Setting Active flag to false in elastic-apm.php does not disable reporting #10

Closed jblotus closed 6 years ago

jblotus commented 6 years ago

Just noticed this while trying to run my tests - even if I hardcode 'active' to false the agent still sends. It doesn't look like the setting is merged in to the agent.

    return new Agent(
                array_merge(
                    [
                        'framework' => 'Laravel',
                        'frameworkVersion' => app()->version(),
                    ],
                    config('elastic-apm.app'),
                    config('elastic-apm.server')
                )
            );

I was able to overcome this by putting 'active' underneath the elastic-apm.app config block (as well as the top level)

Old

return [
    // Sets whether the apm reporting should be active or not
    'active'        => false,

New

// Sets whether the apm reporting should be active or not
'active'        => false,
app' => [
        // Sets whether the apm reporting should be active or not
        'active'        => false,

I would think the fix could be to just merge in the setting.

jblotus commented 6 years ago

https://github.com/philkra/elastic-apm-laravel/pull/11

philkra commented 6 years ago

done with merge og PR #11 , thanks James!