Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kirkmadera opened this issue Sep 23, 2016 · 6 comments

Comments

@kirkmadera
Copy link

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
Copy link
Author

Validated and am making a pull request in a few

@kirkmadera
Copy link
Author

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
Copy link
Author

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

@kirkmadera
Copy link
Author

kirkmadera commented Feb 9, 2017

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\""

@grega
Copy link

grega commented Apr 21, 2017

Can confirm I'm seeing the same issue.

Would be hugely helpful to have #71 merged!

@stevenrombauts
Copy link

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? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants