puppet-newrelic icon indicating copy to clipboard operation
puppet-newrelic copied to clipboard

newrelic_ini_appname does not make it into newrelic.ini (and presumably other vars)

Open kirkmadera opened this issue 9 years ago • 6 comments

The newrelic.ini template attempts to use data with local variable names, but no data is actually being passed to it.

I believe that all parameters in the php agent definition are now ignored because the ini file is created in a separate class scope of newrelic::php::newrelic_ini:

::newrelic::php::newrelic_ini { $newrelic_php_conf_dir:
  exec_path            => $newrelic_php_exec_path,
  newrelic_license_key => $newrelic_license_key,
  before               => [ File['/etc/newrelic/newrelic.cfg'], Service[$newrelic_php_service] ],
  require              => Package[$newrelic_php_package],
  notify               => Service[$newrelic_php_service],
}```

I'm pretty sure the template does not have access to these variables from here. The variables need to get passed into newrelic::php::newrelic_ini or the template needs to refer to each variable with the prefix `newrelic::agent::php` like `newrelic::agent::php::newrelic_ini_appname`

kirkmadera avatar Sep 23 '16 19:09 kirkmadera

Validated and am making a pull request in a few

kirkmadera avatar Sep 23 '16 19:09 kirkmadera

Can anyone review this pull request and merge it in? It breaks in Travis CI, but the errors displayed in the details seem like an issue with Travis CI or its config; not a code issue. This code works and I have been using this on projects since I submitted the PR.

kirkmadera avatar Dec 08 '16 17:12 kirkmadera

Any update on this? We'd like to go back to using a tagged version, but this needs to get merged in.

kirkmadera avatar Feb 09 '17 00:02 kirkmadera

For anyone else hitting this, another workaround is to set it in php settings (if using the mayflower/php)

php::settings:
  newrelic/newrelic.appname: My App Name

You can also do this in Nginx vhosts if using puppet/nginx if you need to set this per application:

nginx::nginx_vhosts:
  myvhost:
    # other code
    locations:
      # Other locations
      index_php:
        location: /index.php
        fastcgi: 127.0.0.1:9000
        index_files: []
        www_root:
        location_cfg_prepend:
          expires: "off"
          fastcgi_read_timeout: 18000
        fastcgi_param:
          SCRIPT_FILENAME: $document_root$fastcgi_script_name
          PHP_VALUE: "newrelic.appname=\"My App Name\""

kirkmadera avatar Feb 09 '17 00:02 kirkmadera

Can confirm I'm seeing the same issue.

Would be hugely helpful to have https://github.com/fsalum/puppet-newrelic/pull/71 merged!

grega avatar Apr 21 '17 08:04 grega

I can also confirm the same issue. The proposed fix in #71 solves the issue. @fsalum Is there any chance you could hit the merge button on that PR? :)

stevenrombauts avatar Jun 22 '17 09:06 stevenrombauts