Your New Relic APM dashboard shows no data, or application performance metrics stopped flowing. The gap in monitoring data means you're flying blind on application performance. Let's diagnose why the APM agent isn't sending data and fix the issue.
Understanding the Problem
New Relic APM agent issues manifest as:
- Empty or missing application in New Relic UI
- No recent transaction data
- Missing error traces
- No deployment markers
- Alert conditions not triggering
Common error patterns:
New Relic agent failed to connect to collectorLicense key is invalid or missingUnable to report data: connection timeoutAgent is disabled or in debug modeInitial Diagnosis
Check agent status and logs for your specific language/framework:
```bash # For Java agents # Check agent log location (varies by setup) cat /var/log/newrelic/newrelic_agent.log | grep -i "error|warn|fail"
# For Node.js agents # Check application logs for New Relic messages grep -i "newrelic|nr_agent" /var/log/app/app.log | tail -50
# For Python agents # Check agent log if configured cat /var/log/newrelic/python_agent.log | grep -i "error"
# For PHP agents cat /var/log/newrelic/php_agent.log | tail -50 # Or check daemon log cat /var/log/newrelic/newrelic-daemon.log
# For .NET agents # Windows Event Viewer > Application logs > New Relic source
# Check agent configuration files # Java: /opt/newrelic/newrelic.yml # Node.js: newrelic.js or newrelic.cjs in app root # Python: newrelic.ini # PHP: /etc/php.d/newrelic.ini # .NET: newrelic.config in app directory ```
Common Cause 1: Invalid or Missing License Key
The most common issue is incorrect license key configuration.
Error pattern:
``
License key is invalid
403 Forbidden: Invalid license keyDiagnosis:
```bash # Check license key in configuration # Java grep "license_key" /opt/newrelic/newrelic.yml
# Node.js grep "license_key" newrelic.js
# Python grep "license_key" newrelic.ini
# PHP grep "newrelic.license" /etc/php.d/newrelic.ini
# Test license key validity curl -X POST "https://collector.newrelic.com/agent_commands/5" \ -H "X-License-Key: your-license-key" \ -H "Content-Type: application/json" ```
Solution:
Update license key in configuration:
```yaml # Java - /opt/newrelic/newrelic.yml common: license_key: 'your_valid_license_key_here'
# Node.js - newrelic.js exports.config = { license_key: 'your_valid_license_key_here', app_name: ['My Application'], ...
# Python - newrelic.ini [newrelic] license_key = your_valid_license_key_here app_name = My Application
# PHP - /etc/php.d/newrelic.ini newrelic.license = "your_valid_license_key_here" newrelic.appname = "My Application"
# .NET - newrelic.config <service licenseKey="your_valid_license_key_here" /> ```
After updating, restart your application:
```bash # Restart the application to apply changes systemctl restart tomcat systemctl restart nginx-php-fpm pm2 restart app
# Or restart just the New Relic daemon for PHP systemctl restart newrelic-daemon ```
Common Cause 2: Network Connectivity Issues
Agent cannot reach New Relic collectors.
Error pattern:
``
Failed to connect to collector-newrelic.com
Connection timeout to 50.31.164.54:443Diagnosis:
```bash # Test connectivity to New Relic endpoints curl -v https://collector.newrelic.com curl -v https://collector-us-east-1.newrelic.com
# Check DNS resolution nslookup collector.newrelic.com
# Test with specific proxy if configured curl -x http://proxy-server:port https://collector.newrelic.com
# Check firewall rules iptables -L -n | grep 443
# Test from application server nc -zv collector.newrelic.com 443 ```
Solution:
Fix network connectivity:
```bash # Allow outbound HTTPS to New Relic # Required endpoints: # collector.newrelic.com:443 (US) # collector.eu.newrelic.com:443 (EU)
iptables -A OUTPUT -p tcp --dport 443 -j ACCEPT
# Configure proxy if required # Java agent proxy_host: proxy-server proxy_port: 8080 proxy_user: username proxy_pass: password
# Node.js agent exports.config = { proxy_host: 'proxy-server', proxy_port: 8080, ...
# PHP agent newrelic.proxy = "proxy-server:8080"
# For EU region, configure collector endpoint # Java host: collector.eu.newrelic.com
# Node.js collector_host: 'collector.eu.newrelic.com' ```
Common Cause 3: Application Name Issues
Application not appearing in New Relic due to name configuration.
Error pattern: No visible application in dashboard despite agent running.
Diagnosis:
```bash # Check application name configuration # Java grep "app_name" /opt/newrelic/newrelic.yml
# Node.js grep "app_name" newrelic.js
# Python grep "app_name" newrelic.ini
# PHP grep "newrelic.appname" /etc/php.ini
# Check for empty or placeholder names grep -E "app_name.*=.*['\"]['\"]|appname.*=" config-file
# Verify in New Relic UI # APM > Services - check if app appears ```
Solution:
Set proper application name:
```yaml # Java app_name: 'Production Application'
# Node.js exports.config = { app_name: ['Production Application', 'Cluster A'], ...
# Python app_name = Production Application
# PHP newrelic.appname = "Production Application"
# .NET <application> <name>Production Application</name> </application>
# Restart application after changes ```
Common Cause 4: Agent Disabled or Inactive
Agent is configured but not actively collecting.
Error pattern:
``
Agent is disabled
Agent in harvest loop inactive stateDiagnosis:
```bash # Check agent enabled setting # Java grep "enabled" /opt/newrelic/newrelic.yml
# Node.js grep "enabled|agent_enabled" newrelic.js
# Check if agent is disabled at runtime # Look for "disabled" in logs grep -i "disabled|inactive" /var/log/newrelic/*.log
# For PHP, check daemon status systemctl status newrelic-daemon
# Check environment variable overrides env | grep NEW_RELIC ```
Solution:
Enable the agent:
```yaml # Java - /opt/newrelic/newrelic.yml agent_enabled: true
# Node.js - newrelic.js exports.config = { agent_enabled: true, ...
# Python - newrelic.ini agent_enabled = true
# PHP newrelic.enabled = true
# Remove environment variable disable if present unset NEW_RELIC_ENABLED=false
# Restart application ```
Common Cause 5: High Security Mode Issues
High security mode blocking data transmission.
Error pattern:
``
High security mode violation
Custom parameters blocked by high securityDiagnosis:
```bash # Check high security mode setting grep -i "high_security" /opt/newrelic/newrelic.yml grep -i "high_security" newrelic.js
# Check New Relic account settings # Account Settings > High Security Mode
# Look for security violations in logs grep -i "security|blocked" /var/log/newrelic/*.log ```
Solution:
Align agent with account security settings:
```yaml # If account has high security enabled, agent must match # Java high_security: true
# Node.js high_security: true
# Disable custom attributes if in high security mode # attributes.include: [] # attributes.exclude: ['request.parameters.*'] ```
Or disable high security in account settings if not required:
# In New Relic UI:
# Account Settings > Security > High Security Mode > Disable
# Requires account admin privilegesCommon Cause 6: Agent Version Incompatibility
Outdated agent version causing communication issues.
Error pattern:
``
Agent version deprecated
Collector rejected agent versionDiagnosis:
```bash # Check agent version # Java - look in newrelic.jar manifest unzip -p /opt/newrelic/newrelic.jar META-INF/MANIFEST.MF | grep Implementation-Version
# Node.js - package.json npm list newrelic
# Python - pip pip show newrelic
# PHP php -i | grep "newrelic version"
# .NET - check DLL version # Check agent log for version info grep -i "version|agent" /var/log/newrelic/*.log | head -10 ```
Solution:
Update agent to latest version:
```bash # Java # Download latest from New Relic wget https://download.newrelic.com/newrelic/java-agent/newrelic-agent-current.zip unzip newrelic-agent-current.zip -d /opt/newrelic-new/ # Update configuration and restart application
# Node.js npm update newrelic # or npm install newrelic@latest
# Python pip install --upgrade newrelic
# PHP # Download and install latest RPM/package yum update newrelic-php5 # or follow New Relic PHP agent installation guide
# .NET # Update via NuGet or MSI installer
# Restart application after update ```
Common Cause 7: Application Not Loading Agent
Agent library not being loaded by application.
Error pattern: No New Relic initialization in application logs.
Diagnosis:
```bash # Check if agent is being loaded # Java - check JVM arguments ps aux | grep java | grep newrelic # Should show: -javaagent:/opt/newrelic/newrelic.jar
# Node.js - check if newrelic is imported grep "require.*newrelic" app.js grep "import.*newrelic" app.js
# Python - check agent initialization grep "newrelic.agent.initialize" app.py
# PHP - check extension loaded php -m | grep newrelic php -i | grep "newrelic"
# For Java, check for -javaagent flag in startup grep -r "javaagent.*newrelic" /opt/tomcat/bin/ grep -r "JAVA_OPTS.*newrelic" /etc/default/ ```
Solution:
Configure agent loading:
```bash # Java - add -javaagent to JVM arguments # In startup script, systemd service, or container JAVA_OPTS="$JAVA_OPTS -javaagent:/opt/newrelic/newrelic.jar"
# For Tomcat echo 'JAVA_OPTS="$JAVA_OPTS -javaagent:/opt/newrelic/newrelic.jar"' >> /etc/default/tomcat
# Node.js - require newrelic first in entry point # app.js (must be first require) require('newrelic');
# Python - initialize early import newrelic.agent newrelic.agent.initialize('/path/to/newrelic.ini')
# PHP - ensure extension is loaded # Check /etc/php.ini or /etc/php.d/newrelic.ini extension=newrelic.so
# Restart application systemctl restart tomcat pm2 restart app systemctl restart php-fpm ```
Common Cause 8: Log Level Too High or Too Low
Agent logging configuration affects troubleshooting.
Error pattern: No visible logs, or logs show no useful information.
Diagnosis:
```bash # Check log level setting grep "log_level" /opt/newrelic/newrelic.yml grep "logging.*level" newrelic.js
# Check if logs are being written ls -la /var/log/newrelic/ ls -la /tmp/newrelic*.log
# Check log destination grep "log_file_path" config-file ```
Solution:
Set appropriate log level for troubleshooting:
```yaml # Java - increase log level log_level: debug log_file_path: /var/log/newrelic/newrelic_agent.log
# Node.js - debug mode exports.config = { logging: { level: 'debug', filepath: '/var/log/newrelic/newrelic_agent.log' }, ...
# Python log_file = /var/log/newrelic/python_agent.log log_level = debug
# PHP newrelic.loglevel = "debug" newrelic.daemon.loglevel = "debug" newrelic.daemon.logfile = "/var/log/newrelic/newrelic-daemon.log"
# After troubleshooting, reduce to info or warning log_level: info ```
Verification
After fixing, verify data is flowing:
```bash # Check agent logs for successful connection tail -f /var/log/newrelic/newrelic_agent.log | grep -i "connect|report|harvest"
# Verify application appears in New Relic # APM > Services - should show application with recent data
# Check transaction data # APM > [Application] > Transactions - should show recent transactions
# Send test transaction curl http://localhost:8080/test-endpoint # Check in New Relic within 1-2 minutes
# Verify error reporting # Trigger a test error and check Error Analytics
# For PHP, verify daemon connection systemctl status newrelic-daemon cat /var/log/newrelic/newrelic-daemon.log | grep -i "connect" ```
Prevention
Monitor agent health:
```bash # Set up alert for missing APM data # In New Relic: Alerts > New alert condition # Metric: Application > Transaction > Response time # Alert when: no data for 5 minutes
# Create agent health dashboard # Track: Application reporting status, transaction count, error rate
# Regular agent health check #!/bin/bash # Check agent logs for errors ERRORS=$(grep -c "error|fail" /var/log/newrelic/newrelic_agent.log) if [ $ERRORS -gt 10 ]; then echo "Agent errors detected: $ERRORS" fi
# Check data reporting curl -s http://localhost:8080/status | jq '.app_status' ```
New Relic APM data issues typically stem from license key problems, network connectivity, or agent initialization. Verify license key first, check network access, then ensure the agent is properly loaded by your application.