Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have a new relic agent configured like so:

newrelic==2.56.0.42

    newrelic.agent.initialize(newrelic_ini_file, newrelic_env)
    logging.info('NewRelic initialized with newrelic_env '+repr(newrelic_env))
    logging.info('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

[newrelic]
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

[newrelic:staging]
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.

What debug logs should I look for, for validating actual data being sent and received 200 from new relic.

Additional details: staging is running on Docker alpine:3.6

like image 256
WebQube Avatar asked Aug 02 '18 09:08

WebQube


People also ask

How does New Relic agent collects data?

New Relic APM collects and stores metrics and data from web-based and other associated applications within the enterprise. New Relic receives data over the network and then processes and analyzes it. Users view the data through a dashboard-type interface.

How often does New Relic send data?

With real time streaming, your APM event data is sent to New Relic every five seconds. You can query and visualize your data for transactions, errors, and custom events in near real time.


1 Answers

The clue to the answer was indeed the debug log of harvest of all application data in 0.00 seconds.

apparently, newrelic.agent.initialize has to go BEFORE app = Flask(__name__). Moved before and it started sending.

like image 99
WebQube Avatar answered Nov 15 '22 00:11

WebQube