Troubleshoot Missing or Delayed Telemetry in New Relic CLI
In this article
This guide walks you through diagnosing why telemetry data from the New Relic CLI is missing or arriving late. You'll check configuration, verify network connectivity, inspect logs, and test the ingestion pipeline step by step. Before starting, ensure you have the New Relic CLI installed, your account ID and API key (or license key) handy, and access to the New Relic UI to verify data.
What You'll Need
- New Relic CLI installed (version 0.6.x or later recommended)
- Your New Relic account ID (found in the UI under Account Settings)
- An Ingestion API key (for metric/event data) or a License key (for agent data)
- Access to a terminal or command prompt
- Network access to
https://metric-api.newrelic.comandhttps://cloud-collector.newrelic.com
Step-by-Step
- Confirm the CLI is installed and up to date. Run
newrelic --version. If it's older than the latest release, update it via your package manager or by downloading the latest binary from the official releases page. Outdated versions may have bugs that affect telemetry. - Check your configuration file. The CLI reads configuration from
~/.newrelic/config.yaml(or the path set byNEW_RELIC_CONFIG_FILE). Open it and verify the following keys are present and correct:account_id: your numeric account IDapi_key: your Ingestion API key (for events/metrics) or license keyregion: set toUSorEUdepending on your data center
- Set environment variables as an alternative. If you prefer not to edit the config file, you can set
NEW_RELIC_ACCOUNT_ID,NEW_RELIC_API_KEY, andNEW_RELIC_REGION. Note that environment variables override the config file. - Test authentication. Run
newrelic telemetry status(ornewrelic agent statusfor agent data) to see if the CLI can authenticate. Look forAuthenticated: trueor a similar success message. If you get a 401 error, your API key is invalid or the region is wrong. - Send a test event. Use the CLI to send a simple event manually. For example:
If the command returns no error, the data was accepted. Check the New Relic UI under Events (or use NRQL) to see if it appears.newrelic telemetry event send --event-type 'TestEvent' --attribute 'foo=bar' - Check network connectivity. Use
curlto test the ingestion endpoints:
If you see connection timeouts or DNS failures, your network may be blocking outbound traffic. Check proxies, firewalls, and VPN settings.curl -v https://metric-api.newrelic.com - Inspect CLI logs. Enable verbose logging with
newrelic telemetry send --verbose(or addlog_level: debugto your config). The logs will show each request, response status, and any errors like 403, 429, or 500. - Verify data in the UI. After sending, go to the New Relic UI and run a NRQL query like
SELECT * FROM TestEvent SINCE 10 minutes ago. If it appears, the pipeline works. If not, the issue is likely in the CLI's batching or timing. - Check for delayed delivery. The CLI batches telemetry and sends it every 5 seconds by default (configurable via
flush_interval). If you see delays longer than that, check your system's clock sync (NTP) and whether the CLI process is being throttled by the OS.
Common Mistakes
- Using the wrong key type. Ingestion API keys are for events/metrics, while license keys are for agent data. Using the wrong one results in 401 errors.
- Mixing up regions. If your account is in the EU, you must set
region: EU. Sending to the US endpoint will silently drop data. - Typos in attribute names. The CLI sends attributes as-is; a typo means you'll see the event but not the expected attribute.
- Relying on default config path. If you set
NEW_RELIC_CONFIG_FILEelsewhere, the CLI won't read the default file. - Ignoring exit codes. The CLI returns non-zero exit codes on failure. Always check the exit code in scripts.
Tips
- Use the
--dry-runflag (if available) to see what would be sent without actually sending. - Set
flush_intervallower (e.g., 2 seconds) for near-real-time data, but be aware of rate limits. - Write your telemetry sending script to log the CLI output to a file for later inspection.
- Use the
newrelic telemetry batchsubcommand to send multiple events in one request, which is more efficient.
Troubleshooting
If the steps above don't resolve the issue:
- Check the CLI's exit code. If it's non-zero, run with
--verboseto see the exact error message. - Look for 429 status codes. This means you're hitting rate limits. The CLI will retry automatically, but if you're sending too much data, reduce the volume or increase the flush interval.
- Inspect the payload. Use
--verboseto see the JSON payload. Ensure the event type and attributes are in the correct format (e.g., timestamps in Unix time). - Check the system clock. If your system time is off by more than a few minutes, New Relic may reject the data as too old or too far in the future.
- Test with a different network. If you're behind a corporate proxy, try from a different network to isolate the issue.
- Reinstall the CLI. If all else fails, uninstall and reinstall the CLI to ensure no corrupted files.
Frequently Asked Questions
Why is my telemetry not showing up in the UI at all?
Most likely a configuration issue: wrong API key, wrong region, or a firewall blocking outbound traffic. Run newrelic telemetry status and check the verbose logs for HTTP error codes.
How long does it take for telemetry to appear?
Normally within 5-10 seconds after the CLI flushes its buffer. If it takes longer, check your network latency and the flush_interval setting.
Can I send telemetry from behind a proxy?
Yes, set the HTTP_PROXY or HTTPS_PROXY environment variables. The CLI respects these.
What does a 403 error mean?
It means the API key is valid but lacks permission for the specific data type. For example, a license key cannot send custom events. Use an Ingestion API key.
Is there a way to test without sending real data?
Use the --dry-run flag if your CLI version supports it. It will print the payload to stdout without sending.
Why are my timestamps off by hours?
The CLI uses the system clock. If your timezone is set incorrectly, the timestamp will be wrong. Use NTP to sync your clock, and consider sending timestamps in UTC.