In Python it is also installed as a package, and then runs as a
wrapper around the python/django application.
To use the wrapper script
when running a standalone WSGI server or web application, you
will need to modify the existing startup command you use for
that WSGI server or web application. At the same time, you must
set environment variables to tell the wrapper script where the
agent configuration file is located or what the license key is.
In general terms, if you
you are currently executing your WSGI server or web application
as:
command options
you would now need to run
it instead as:
NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program command
options
The wrapper script is
'newrelic-admin' and is being run with the 'run-program' option.
This is prefixing the complete existing command you used
previously when starting your WSGI server or web application.
I thought someone might have already come up with a way to modify
the supervisor config file in that manner.
On 06/29/2013 11:00 AM, Mathieu Martin
wrote:
"
type="cite">Not sure how it's done in the python world.
But in the Ruby world, the NewRelic app monitoring is simply
added as any other application gem (library). So it's available
in dev with a useful dev mode. And it's automatically installed
upon deployment by Bundler.
Is there something similar in the Python world?
And you're right, server monitoring is a breeze to install.
And very useful.
Mat
On Saturday, June 29, 2013, Liam Kirsher wrote:
Hi --
Anyone have experience adding newrelic?
I'm adding newrelic monitoring to an application that uses
django/gunicorn/supervisor.
First, I notice that there are three opscode newrelic
cookbooks:
newrelic_monitoring
newrelic-ng
newrelic
It looks like the newrelic-ng is the only one that includes
application,
as opposed to system, monitoring. Is that correct?
Also, it looks like it doesn't automatically setup monitoring.
I think
you still have to modify the supervisor template in order to
run the
newrelic wrapper script.
That doesn't look to hard, but I don't want to re-invent the
wheel if
someone else has already done this.
An example would be useful.
I'm also going to add the newrelic server monitoring, but that
looks
simple since it's relatively independent.
Thanks!
Liam
--
Liam Kirsher
PGP: http://liam.numenet.com/pgp/
--
--
I'm the founder of
Rock Solid Ops Inc, a web consultancy.
My main fields of
expertise are Ruby on Rails web development, DevOps and a
bit of mobile. If you need help scaling, understanding,
securing or managing your web infrastructure (Rails or not),
get in touch!
If you're a tech person, the
following may make sense to you.
I'm the author of git_remote_branch. A tool that's
been helping common mortals like me share git branches
for 5 years. Downloaded 50 000 times.
I've also contributed to some of
the popular libraries in the Rails, jQuery and PhoneGap
ecosystems:
paperclip, active_admin, jquery-ujs, jquery-rails, kaminari, AssetSync, phonegap-plugin-facebook-connect, shoulda, woulda, jeweler.
If you visit them on GitHub, you'll
see my face in the "Contributors" section :-)
--
Liam Kirsher
PGP: http://liam.numenet.com/pgp/
|