Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Newrelic python agent is not sending data to newrelic servers at staging only


I have a new relic agent configured like so:


newrelic.agent.initialize(newrelic_ini_file, newrelic_env)'NewRelic initialized with newrelic_env '+repr(newrelic_env))'NewRelic config name is '+repr(newrelic.agent.application().name))

It’s logging the “right” things in staging, but it’s not sending.

NewRelic initialized with newrelic_env ‘staging’
NewRelic config name is ‘My Service (Staging)’
The agents send data from localhost and production.

This is some configs from the newrelic.ini file

license_key = xxxxx
app_name = My Service
monitor_mode = true
log_file = /tmp/newrelic-python-agent.log
log_level = info
This is my staging config in newrelic.ini

app_name = My Service (Staging)
monitor_mode = true
log_level = debug
One log that I think is suspicious is this

(14/NR-Harvest-Thread) newrelic.core.agent DEBUG - Completed harvest of all application data in 0.00 seconds.
I think the agent not collecting any data due to the 0.00 seconds part.


@OriMarko Thanks for your post. Can you confirm your staging instance is receiving traffic?


Issue solve due to change in script
newrelic.agent.initialize Moved before app = Flask(name).


Great work @OriMarko, glad to hear you got this resolved :smiley: