ekino / EkinoNewRelicBundle

Add NewRelic support to Symfony
MIT License
280 stars 104 forks source link

Command line app is not tracked #211

Open Kolesar opened 5 years ago

Kolesar commented 5 years ago

My configuration is like:

ekino_new_relic:
    enabled: true
    application_name:  "Service Name"
    deployment_names: ~
    api_key: "%env(NEWRELIC_API_KEY)%"
    logging: true
    interactor: ~ 
    twig: false
    exceptions: true
    deprecations: true
    http:
        enabled: false
    monolog:
        enabled: true
        channels: [app]
        level: error
    commands:
        enabled: true
        ignored_commands: []

In the New Relic dashboard I see this "Service Name" name in the Application list, but, all transaction are tracked under default name from the newrelic.ini file.

My application is the console one and unfortunately, I see there only main command: bin/console nothing deeper which command exactly is run, because bin/console has arguments, of course, and it is multiprocessing application.

I'm new with New Relic and do not know how it works in details. Any help or hint here is welcome.

jderusse commented 5 years ago

Hi Kolesar,

Thank for the report, I personnaly use the .ini file to configure my application_name, BUT, I didn't see why this parameter wouldn't work (neither does the transaction naming).

Could you, please, help us by "debugging your application by adding "logs" or "dumps" in the NewRelicInteractor file?

    public function setApplicationName(string $name, string $license = null, bool $xmit = false): bool
    {
        dump($name);
        return newrelic_set_appname($name, $license, $xmit);
    }

    public function setTransactionName(string $name): bool
    {
        dump($name);
        return newrelic_name_transaction($name);
    }

And check if those 2 methods are called with the right parameters.

I also notice that you open issue in Monolog's repository, did you configured the Monolog Handler with an other application name ? Or are you sending logs with a context containing the keys transaction_name or appname?

ne0h12 commented 5 years ago

@Kolesar you will attempt to set config "using_symfony_cache: true" in node http. It is work for me.

jderusse commented 4 years ago

did it worked? @Kolesar