Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Troubleshoot Missing or Delayed Telemetry in New Relic CLI

· 5 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

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.com and https://cloud-collector.newrelic.com

Step-by-Step

  1. 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.
  2. Check your configuration file. The CLI reads configuration from ~/.newrelic/config.yaml (or the path set by NEW_RELIC_CONFIG_FILE). Open it and verify the following keys are present and correct:
    • account_id: your numeric account ID
    • api_key: your Ingestion API key (for events/metrics) or license key
    • region: set to US or EU depending on your data center
    If any are missing or misspelled, correct them.
  3. 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, and NEW_RELIC_REGION. Note that environment variables override the config file.
  4. Test authentication. Run newrelic telemetry status (or newrelic agent status for agent data) to see if the CLI can authenticate. Look for Authenticated: true or a similar success message. If you get a 401 error, your API key is invalid or the region is wrong.
  5. Send a test event. Use the CLI to send a simple event manually. For example:
    newrelic telemetry event send --event-type 'TestEvent' --attribute 'foo=bar'
    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.
  6. Check network connectivity. Use curl to test the ingestion endpoints:
    curl -v https://metric-api.newrelic.com
    If you see connection timeouts or DNS failures, your network may be blocking outbound traffic. Check proxies, firewalls, and VPN settings.
  7. Inspect CLI logs. Enable verbose logging with newrelic telemetry send --verbose (or add log_level: debug to your config). The logs will show each request, response status, and any errors like 403, 429, or 500.
  8. 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.
  9. 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_FILE elsewhere, 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-run flag (if available) to see what would be sent without actually sending.
  • Set flush_interval lower (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 batch subcommand 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 --verbose to 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 --verbose to 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.