New Relic
Summary
New Relic provides performance tracking. You can use New Relic to drive insights into values such as:
- Error rates
- Throughput
- Apdex
- Open Telemetry
- Live entities in your environment
- Embedded dashboards
- Dependencies
- SLOs
Setup
In order to connect Cortex to your New Relic instance, you’ll need to create a New Relic User Token, and add it under Settings → New Relic.
The New Relic integration has multi-account support so you can add a configuration for each additional by repeating the above process.
Each configuration requires an alias, which Cortex uses to correlate the designated with registrations for various entities. Registrations can also use a default configuration without a listed alias.
You can edit aliases and default configurations from the New Relic page in settings. Select the edit icon next to a given configuration and toggle "Set as default" on. If you only have one configuration, it will automatically be set as the default.
If you do not see the settings page you're looking for, you likely don't have the proper permissions and need to contact your admin.
Registration
APM
New Relic application metrics can be fetched for each entity using application ID or tags.
Instructions to find your Application ID can be found in the New Relic docs. You can also find the Application ID in the URL in New Relic. Aliases tie the entity registration to a New Relic configuration listed under Settings → New Relic. The alias parameter is optional, but if not provided the entity will use the default configuration under Settings → New Relic.
x-cortex-apm:
newrelic:
applications:
- applicationId: 1234567
alias: Default-App # alias is optional and only relevant if you have opted into multi account support
- applicationId: 1234567
alias: Another-App # alias is optional and only relevant if you have opted into multi account support
tags:
- tag: tagKey
value: tagValue
alias: Default-App # alias is optional and only relevant if you have opted into multi account support
OpenTelemetry
OpenTelemetry services can be associated with the entity only using tags. For this type of service New Relic doesn't generate application ID.
x-cortex-apm:
newrelic:
tags:
- tag: tagKey
value: tagValue
alias: Default-App # alias is optional and only relevant if you have opted into multi account support
Scorecards and CQL
OpenTelemetry metrics avaiable in New Relic Metrics Exlorer can be accessed or manipulated in scope of entity using CQL and NRQL native query.
Accessing OpenTelemetry data in scope of entity with CQL and New Relic entity guid
In CQL you can access in scope of entity guid of OpenTelemetry service and it allows you to query for specific metrics.
Definition: newrelic.applications().getOrNull(0)?.guid
Example
You can execute raw NRQ query to collect average http.server.requests
newrelic.rawNrql("SELECT average(`http.server.requests`) FROM Metric WHERE `entity.guid` = '"+newrelic.applications().getOrNull(0)?.guid+"' SINCE 7 DAYS AGO")
Embeds
Cortex can also embed dashboards from New Relic.
x-cortex-dashboards:
embeds:
- type: newrelic
url: https://chart-embed.service.newrelic.com/herald/6b334ae2-b1e0-412c-b714-826a5aed8358
SLOs
SLO can be fetched for each entity using New Relic entity guid for respective SLO or associated service. Detailed instructions how to obtain entity guid can be found in New Relic docs.
Fetched SLO information can be found in the Operations
and Integrations
sections of an entity page.
x-cortex-slos:
newrelic:
- id: MjU5ODYxOXxFWFR8U0VSVklDRV9MRVZFTHiw0TI5ODQ
alias: my-default-alias
- id: MjU5ODYxOXxFWFR8U0VSVklDRV9MRVZFTHiw0TI76QB
alias: my-other-alias
- id: MjU5ODYxOXxFWFRAB6VSVklDRV9MRVZFTHiw0TI76QD
Field | Description | Required |
---|---|---|
id | New Relic entity guid for the SLO or the associated service | true |
alias | Alias for the configuration in Cortex (only needed if you have opted into multi-account support) | false |
Dependencies
Cortex automatically syncs dependencies from New Relic into Cortex. By default, we map entries found in New Relic's entity map using the entity identifier (x-cortex-tag
).
For example, if you have two entities "entity-one" and "entity-two" that have a dependency edge in New Relic's entity map, we expect both entities to exist in Cortex with the same entity identifiers.