Getting started overview

Getting started with New Relic involves setting up an account, obtaining necessary API keys for authentication, and then instrumenting your applications or infrastructure to send telemetry data. New Relic offers various methods for data ingestion, primarily through language-specific agents or direct API calls. The initial setup focuses on ensuring data flows into the New Relic platform so you can begin monitoring and analysis.

The core process typically follows these steps:

  1. Account Creation: Sign up for a New Relic account. A free tier is available, offering 100 GB of data ingest per month.
  2. Key Generation: Obtain the required API keys, such as the License Key and personal API keys, which authenticate your data submissions and API interactions.
  3. Instrumentation: Install and configure a New Relic agent in your application or environment, or make direct API calls to send data.
  4. Data Verification: Confirm that data is flowing into your New Relic account by checking the platform UI.

Quick reference table for New Relic setup

Step What to do Where
Sign up Create a New Relic account New Relic Signup Page
Get License Key Locate your account's License Key for agent configuration New Relic UI: Account settings > API keys
Generate User API Key Create a personal API key for programmatically interacting with New Relic APIs New Relic UI: API keys page
Install Agent Choose and install the appropriate agent for your application language or infrastructure New Relic APM documentation or New Relic Infrastructure documentation
Configure Agent Set the License Key and other agent-specific parameters Agent configuration file (e.g., newrelic.yml for Java)
Verify Data Check for incoming data streams and metrics New Relic UI: APM, Infrastructure, or Logs explorer

Create an account and get keys

To begin, navigate to the New Relic signup page and complete the registration process. This provides access to the New Relic platform, including the free tier which allows for up to 100 GB of data ingest per month and one free Full Platform User as described on their pricing page. After creating your account, you will need to locate or generate specific API keys to enable data ingestion and API interactions.

New Relic License Key

The New Relic License Key is a primary identifier for your account and is used by most New Relic agents (Application Performance Monitoring, Infrastructure, Browser, Mobile) to associate telemetry data with your account. You can find your License Key within the New Relic UI by navigating to the API keys section under your account settings as specified in the New Relic API key documentation.

Steps to retrieve your License Key:

  1. Log in to your New Relic account.
  2. Click on the account dropdown in the top right corner.
  3. Select API keys.
  4. Locate the License key entry. Copy this key for use in agent configurations.

New Relic Personal API Keys (User API Keys)

Personal API keys, often referred to as User API Keys, are used for programmatic access to the New Relic platform, including querying data via NRQL, managing alerts, or deploying applications via the NerdGraph API New Relic NerdGraph API documentation. These keys are associated with a specific user and inherit that user's permissions.

Steps to generate a Personal API Key:

  1. Log in to your New Relic account.
  2. Navigate to the API keys section.
  3. Click the Add a key button.
  4. Select User key as the key type.
  5. Provide a descriptive name for the key (e.g., "My First Integration Key").
  6. Choose the appropriate scope for the key (e.g., APM_READ, SYNTHETICS_WRITE). For general API interactions, often a broad scope is initially chosen, but it is recommended to limit permissions in production environments following the principle of least privilege, a common security practice often discussed by organizations like the Google Cloud documentation on least privilege.
  7. Click Generate key and copy the generated key. This key will only be shown once.

Your first request

A "first request" in New Relic context typically means successfully sending telemetry data from your application or infrastructure into the New Relic platform. This is most commonly achieved by installing and configuring a New Relic agent. For this guide, we'll demonstrate a simple first data ingest using a Python application with the New Relic APM agent.

Example: Python APM Agent Setup

This example assumes you have a basic Python application (e.g., a Flask or Django app) and your New Relic License Key ready.

Prerequisites:

  • Python installed (version 3.6 or higher)
  • A simple Python application (e.g., a "Hello World" Flask app)

Steps:

  1. Install the New Relic Python agent:

    pip install newrelic
  2. Generate the agent configuration file:

    Run the following command in your terminal. This creates a newrelic.ini file in your current directory.

    newrelic-admin generate-config YOUR_LICENSE_KEY newrelic.ini

    Replace YOUR_LICENSE_KEY with the actual License Key you retrieved from the New Relic UI.

  3. Configure the agent:

    Open the generated newrelic.ini file. Ensure the following settings are correctly configured:

    • license_key = YOUR_LICENSE_KEY (should be pre-filled)
    • app_name = My Python App (set a descriptive name for your application)
    • monitor_mode = true

    For more detailed configuration options, refer to the New Relic Python Agent configuration documentation.

  4. Run your application with the agent:

    Prefix your application's run command with newrelic-admin run-program.

    If you have a simple Python script (e.g., app.py):

    NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program python app.py

    If you are running a Flask application (e.g., export FLASK_APP=app.py; flask run):

    NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program flask run

    Ensure that the NEW_RELIC_CONFIG_FILE environment variable points to your newrelic.ini file.

  5. Verify data in New Relic:

    Allow a few minutes for data to begin flowing. Log in to your New Relic account, navigate to APM, and you should see your "My Python App" listed, with initial metrics appearing on its dashboard. If your application handles web requests, make a few requests to generate some transaction data.

Common next steps

Once you've successfully sent your first data to New Relic, consider these common next steps to expand your observability:

  • Explore APM Dashboards: Dive into the automatically generated dashboards for your application. Look at transaction throughput, error rates, and response times.
  • Set up custom dashboards: Create custom dashboards to visualize specific metrics important to your team using NRQL (New Relic Query Language). The New Relic NRQL documentation provides an overview.
  • Configure Alerts: Set up alert conditions based on critical metrics (e.g., high error rates, low memory) to be notified of issues.
  • Add More Agents: Instrument other services, databases, or infrastructure components (servers, containers, Kubernetes) using the New Relic Infrastructure agent.
  • Integrate with Logs: Forward your application and system logs to New Relic for centralized log management and correlation with other telemetry data. Review the New Relic Logs getting started guide.
  • Browser and Mobile Monitoring: If applicable, integrate Browser monitoring for real user experience data or Mobile monitoring for iOS/Android applications.
  • Synthetic Monitoring: Create synthetic monitors to proactively test your application's availability and performance from various global locations.

Troubleshooting the first call

Encountering issues when sending initial data to New Relic is common. Here are troubleshooting steps:

  • Verify License Key: Double-check that the License Key in your agent configuration or API request is exactly correct and belongs to the New Relic account you are expecting data in. Even a single character mismatch can prevent data transmission.
  • Check Agent Logs: New Relic agents generate their own logs. Review these logs (e.g., in /var/log/newrelic/ or specified in your agent config) for error messages or warnings related to connection issues, invalid keys, or data processing.
  • Network Connectivity: Ensure your application's host can reach New Relic's data ingestion endpoints. New Relic agents use specific ports and domains for communication. Consult the New Relic network requirements documentation for up-to-date endpoint information. Firewall rules or proxy settings can block these connections.
  • Application Restart: After installing and configuring an agent, typically a full restart of your application or web server is required for the agent to initialize and begin sending data.
  • Application Activity: Some agents only send data when the application is actively processing requests or performing work. Ensure there is traffic or activity in your application after agent installation. For example, make a few web requests to your Flask application in the Python example.
  • Supported Versions: Verify that your application's language runtime, framework, and any libraries are compatible with the installed New Relic agent version. Compatibility matrices are usually found in the agent-specific documentation.
  • Proxy Configuration: If your environment uses a proxy server, ensure the New Relic agent is correctly configured to use it. Many agents have specific settings for proxy hosts and ports.
  • Time Sync: Ensure the system clock on the host running the agent is synchronized (e.g., with NTP). Significant clock drift can cause issues with SSL/TLS handshakes and data timestamping.
  • New Relic Status Page: Check the New Relic status page to ensure there are no ongoing platform-wide incidents affecting data ingest.
  • Support: If issues persist, gather agent logs and configuration files and contact New Relic Support for assistance.