Ruben Saez
Ruben Saez

Reputation: 3

Python Newrelic agent no data

im trying to install newrelic python agent on my server but i just cant. I did what is said here newrelic and i started the server like this:

NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program nohup python code.py 80 & 

but it doest work.I also tryed to add

import newrelic.agent
newrelic.agent.initialize('newrelic.ini')

on my code.py file which is where i start the web app but then if i do

nohup python code.py 80 & 

the web app code.py doest work

update:: I dont know how but i think it started just for like 20 sec. I closed the root terminal and it stoped i think becasue of that. now it says in newrelic.com:

No data reporting for this application - troubleshoot

can someone help me? pd: sorry for my english

Upvotes: 0

Views: 771

Answers (1)

Peter
Peter

Reputation: 448

This might be late, but I ran into a similar issue as well. Instead of using newrelic.ini I was able to get this working using environment variables instead of using the newrelic.ini file.

import newrelic.agent
newrelic.agent.initialize()

Then, set environment variables for the NEW_RELIC_APP_NAME and NEW_RELIC_LICENSE_KEY before running your python application.

Bash:

export NEW_RELIC_APP_NAME="Python App"
export NEW_RELIC_LICENSE_KEY="XXXXXXXXXXXXXXXXNRAL"
python3 web.py

Upvotes: 1

Related Questions