Skip to main content

Profiling with New Relic agent

As of November 2026, New Relic has mature profiling support for Java, and early preview support for some other languages, with more coverage planned over time. CubeAPM, at present, supports profiling with New Relic only for Java. Support for other languages will be added as they mature.

Coverage​

ItemSupport
Profile typeCPU. Values are sample counts, not CPU time.
JVM metricsCPU load, heap memory, garbage collection, thread allocation, metaspace, thread context switches.
Not availableAllocation, lock and wall-clock profiles, the link from a trace to its profile, and the endpoint breakdown. The New Relic agent does not send the data these need.

Integration​

  1. Install New Relic agent

    Support for profiling is built into the New Relic APM agent itself. So, the first step is to install the New Relic Java agent.

  2. Turn on profiling in the agent

    Profiling is off by default. Turn it on for each application, then restart it.

    app_name: <app_name>
    license_key: 'ABC4567890ABC4567890ABC4567890ABC4567890'
    # Use your load balancer's domain name here
    host: <cubeapm-newrelic.yourdomain.com>
    event_ingest_uri: https://<cubeapm-newrelic.yourdomain.com>/api/logs/v1/push/newrelic/events
    metric_ingest_uri: https://<cubeapm-newrelic.yourdomain.com>/api/metrics/v1/push/newrelic/metric/v1
    jfr:
    enabled: true
    info

    To give profiles an environment, write the app name as <app_name>%<env>, for example order-service%sandbox. The semicolon convention from the multi-environment setup is not supported by the profiler, and it results in profiles getting mapped to UNSET environment. Using percent works well for all cases.