Skip to main content

New Relic

Our New Relic integration allows you to import entities and issues from your New Relic cloud account into Port, according to your mapping and definition.

An Entity can be a host, an application, a service, a database, or any other component that sends data to New Relic.
An Issue is a group of incidents that describe the underlying problem of your symptoms.

Common use cases

  • Map your monitored applications and services in New Relic with their current open alerts.
  • Watch for new alerts and updates raised on your monitored applications and automatically synchronize them into Port.

Prerequisites

To install the integration, you need a Kubernetes cluster that the integration's container chart will be deployed to.

Please make sure that you have kubectl and helm installed on your machine, and that your kubectl CLI is connected to the Kubernetes cluster where you plan to install the integration.

Troubleshooting

If you are having trouble installing this integration, please refer to these troubleshooting steps.

Installation

Choose one of the following installation methods:

Using this installation option means that the integration will be hosted by Port, with a customizable resync interval to ingest data into Port.

To install, follow the following steps:

  1. Go to the Data sources page of your portal.

  2. Click on the + Data source button in the top-right corner.

  3. Click on the relevant integration in the list.

  4. Under Select your installation method, choose Hosted by Port.

  5. Configure the integration settings and application settings as you wish (see below for details).

Application settings

Every integration hosted by Port has the following customizable application settings:

  • Resync interval: The frequency at which Port will ingest data from the integration. There are various options available, ranging from every 1 hour to once a day.

  • Send raw data examples: A boolean toggle (enabled by default). If enabled, raw data examples will be sent from the integration to Port. These examples are used when testing your mapping configuration, they allow you to run your jq expressions against real data and see the results.

Integration settings

Every integration has its own tool-specific settings, under the Integration settings section.
Each of these settings has an ⓘ icon next to it, which you can hover over to see a description of the setting.

Port secrets

Some integration settings require sensitive pieces of data, such as tokens.
For these settings, Port secrets will be used, ensuring that your sensitive data is encrypted and secure.

When changing such a setting, you will be prompted to choose an existing secret or create a new one:

Live event support

Currently, live events are not supported for integrations hosted by Port.
Resyncs will be performed periodically, based on the Resync interval you have configured, or manually triggered by you via Port's UI.

Therefore, real-time events such as GitOps pushes will not be ingested into Port immediately.
Live events are WIP and will be supported in the future.

Ingesting Newrelic objects

The Newrelic integration uses a YAML configuration to describe the process of loading data into the developer portal.

Here is an example snippet from the config which demonstrates the process for getting Issue data from Newrelic:

resources:
- kind: newRelicAlert
selector:
query: "true"
newRelicTypes: ["ISSUE"]
port:
entity:
mappings:
blueprint: '"newRelicAlert"'
identifier: .issueId
title: .title[0]
properties:
priority: .priority
state: .state
sources: .sources
conditionName: .conditionName
alertPolicyNames: .policyName
activatedAt: .activatedAt
relations:
newRelicService: .__APPLICATION.entity_guids + .__SERVICE.entity_guids

The integration makes use of the JQ JSON processor to select, modify, concatenate, transform and perform other operations on existing fields and values from Newrelic's API events.

Configuration structure

The integration configuration determines which resources will be queried from Newrelic, and which entities and properties will be created in Port.

Supported resources

The following resources can be used to map data from Newrelic, it is possible to reference any field that appears in the API responses linked below for the mapping configuration.

  • The root key of the integration configuration is the resources key:

    resources:
    - kind: project
    selector:
    ...
  • The kind key is a specifier for a Newrelic object:

      resources:
    - kind: project
    selector:
    ...
  • The selector key allows you to filter which objects of the specified kind will be ingested into your software catalog:

    resources:
    - kind: newRelicService
    selector:
    query: "true"
    newRelicTypes: ["SERVICE", "APPLICATION"]
    calculateOpenIssueCount: true
    entityQueryFilter: "type in ('SERVICE','APPLICATION')"
    entityExtraPropertiesQuery: |
    ... on ApmApplicationEntityOutline {
    guid
    name
    }
    • newRelicTypes - An array of Newrelic entity types that will be fetched. The default value is ['SERVICE', 'APPLICATION']. This is related to the type field in the Newrelic entity.
    • calculateOpenIssueCount:
      • A boolean value that indicates if the integration should calculate the number of open issues for each entity. The default value is `false``.
      • NOTE - This can cause a performance degradation as the integration will have to calculate the number of open issues for each entity, which unfortunately is not supported by the New Relic API.
    • entityQueryFilter:
      • A filter that will be applied to the New Relic API query. This will be placed inside the query field of the entitySearch query in the New Relic GraphQL API. For examples of query filters click here.
      • Not specifying this field will cause the integration to fetch all the entities and map them to the blueprint defined in the kind.
      • Rule of thumb - Most of the time the EntityQueryFilter will be the same as the NewRelicTypes. For example, if we want to fetch all the services and applications we will set the EntityQueryFilter to type in ('SERVICE','APPLICATION') and the NewRelicTypes to ['SERVICE', 'APPLICATION'].
    • entityExtraPropertiesQuery:
      • An optional property that allows defining extra properties to fetch for each Newrelic entity. This will be concatenated with the default query properties we are requesting under the entities section in the entitySearch query in the Newrelic GraphQL API. For examples of additional query properties click here.
  • The port, entity and the mappings keys are used to map the Newrelic object fields to Port entities. To create multiple mappings of the same kind, you can add another item in the resources array;

    resources:
    - kind: newRelicAlert
    selector:
    query: "true"
    newRelicTypes: ["ISSUE"]
    port:
    entity:
    mappings:
    blueprint: '"newRelicAlert"'
    identifier: .issueId
    title: .title[0]
    properties:
    priority: .priority
    state: .state
    sources: .sources
    conditionName: .conditionName
    alertPolicyNames: .policyName
    activatedAt: .activatedAt
    relations:
    newRelicService: .__APPLICATION.entity_guids + .__SERVICE.entity_guids
    - kind: newRelicAlert # In this instance project is mapped again with a different filter
    selector:
    query: '.name == "MyIssuetName"'
    port:
    entity:
    mappings: ...
    Blueprint key

    Note the value of the blueprint key - if you want to use a hardcoded string, you need to encapsulate it in 2 sets of quotes, for example use a pair of single-quotes (') and then another pair of double-quotes (")

Tags

Some Newrelic entities have a property named tags which contains potentially useful information such as machine information, hostname, agent name & version, and more. For example:

"tags": [
{
"key": "coreCount",
"values": [
"10"
]
},
{
"key": "hostStatus",
"values": [
"running"
]
},
]

Before mapping, this integration performs a tranformation on each tag, after which the example above would look like this:

tags = ["coreCount":"10","hostStatus":"running"]

Ingest data into Port

To ingest Newrelic objects using the integration configuration, you can follow the steps below:

  1. Go to the DevPortal Builder page.
  2. Select a blueprint you want to ingest using Newrelic.
  3. Choose the Ingest Data option from the menu.
  4. Select Newrelic under the APM & alerting category.
  5. Add the contents of your integration configuration to the editor.
  6. Click Resync.

Examples

Examples of blueprints and the relevant integration configurations:

Service (Entity)

Service blueprint
{
"identifier": "newRelicService",
"description": "This blueprint represents a New Relic service or application in our software catalog",
"title": "New Relic Service",
"icon": "NewRelic",
"schema": {
"properties": {
"has_apm": {
"title": "Has APM",
"type": "boolean"
},
"open_issues_count": {
"title": "Open Issues Count",
"type": "number",
"default": 0
},
"link": {
"title": "Link",
"type": "string",
"format": "url"
},
"reporting": {
"title": "Reporting",
"type": "boolean"
},
"tags": {
"title": "Tags",
"type": "object"
},
"account_id": {
"title": "Account ID",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
},
"domain": {
"title": "Domain",
"type": "string"
},
"throughput": {
"title": "Throughput",
"type": "number"
},
"response_time_avg": {
"title": "Response Time AVG",
"type": "number"
},
"error_rate": {
"title": "Error Rate",
"type": "number"
},
"instance_count": {
"title": "Instance Count",
"type": "number"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: newRelicService
selector:
query: "true"
newRelicTypes: ["SERVICE", "APPLICATION"]
calculateOpenIssueCount: true
entityQueryFilter: "type in ('SERVICE','APPLICATION')"
entityExtraPropertiesQuery: |
... on ApmApplicationEntity {
guid
name
alertSeverity
applicationId
apmBrowserSummary {
ajaxRequestThroughput
ajaxResponseTimeAverage
jsErrorRate
pageLoadThroughput
pageLoadTimeAverage
}
apmSummary {
apdexScore
errorRate
hostCount
instanceCount
nonWebResponseTimeAverage
nonWebThroughput
responseTimeAverage
throughput
webResponseTimeAverage
webThroughput
}
}
port:
entity:
mappings:
blueprint: '"newRelicService"'
identifier: .guid
title: .name
properties:
has_apm: 'if .domain | contains("APM") then "true" else "false" end'
link: .permalink
open_issues_count: .__open_issues_count
reporting: .reporting
tags: .tags
domain: .domain
type: .type

Issue

Issue blueprint
{
"identifier": "newRelicAlert",
"description": "This blueprint represents a New Relic alert in our software catalog",
"title": "New Relic Alert",
"icon": "NewRelic",
"schema": {
"properties": {
"priority": {
"type": "string",
"title": "Priority",
"enum": ["CRITICAL", "HIGH", "MEDIUM", "LOW"],
"enumColors": {
"CRITICAL": "red",
"HIGH": "red",
"MEDIUM": "yellow",
"LOW": "green"
}
},
"state": {
"type": "string",
"title": "State",
"enum": ["ACTIVATED", "CLOSED", "CREATED"],
"enumColors": {
"ACTIVATED": "yellow",
"CLOSED": "green",
"CREATED": "lightGray"
}
},
"trigger": {
"type": "string",
"title": "Trigger"
},
"sources": {
"type": "array",
"title": "Sources"
},
"alertPolicyNames": {
"type": "array",
"title": "Alert Policy Names"
},
"conditionName": {
"type": "array",
"title": "Condition Name"
},
"activatedAt": {
"type": "string",
"title": "Time Issue was activated"
}
},
"required": []
},
"mirrorProperties": {},
"calculationProperties": {},
"relations": {
"newRelicService": {
"title": "New Relic Service",
"target": "newRelicService",
"required": false,
"many": true
}
}
}
Integration configuration
createMissingRelatedEntities: true
deleteDependentEntities: true
resources:
- kind: newRelicAlert
selector:
query: "true"
newRelicTypes: ["ISSUE"]
port:
entity:
mappings:
blueprint: '"newRelicAlert"'
identifier: .issueId
title: .title[0]
properties:
priority: .priority
state: .state
sources: .sources
conditionName: .conditionName
alertPolicyNames: .policyName
activatedAt: .activatedAt
relations:
newRelicService: .__APPLICATION.entity_guids + .__SERVICE.entity_guids

Let's Test It

This section includes a sample response data from New Relic. In addition, it includes the entity created from the resync event based on the Ocean configuration provided in the previous section.

Payload

Here is an example of the payload structure from New Relic:

Service (Entity) response data
{
"accountId": 4444532,
"alertSeverity": "NOT_CONFIGURED",
"domain": "INFRA",
"entityType": "INFRASTRUCTURE_HOST_ENTITY",
"guid": "MTIzNDU2Nzg5fElORlJBfE5BfDY1MjQwNDc0NjE4MzUyMDkwOTU=",
"lastReportingChangeAt": 1715351571254,
"name": "UserMacbook",
"permalink": "https://one.eu.newrelic.com/redirect/entity/MTIzNDU2Nzg5fElORlJBfE5BfDY1MjQwNDc0NjE4MzUyMDkwOTU=",
"reporting": true,
"tags": [
{
"key": "account",
"values": [
"Account 4444831"
]
},
{
"key": "accountId",
"values": [
"4444831"
]
},
{
"key": "agentName",
"values": [
"Infrastructure"
]
},
{
"key": "agentVersion",
"values": [
"1.50.0"
]
},
{
"key": "coreCount",
"values": [
"8"
]
},
{
"key": "fullHostname",
"values": [
"usermacbook"
]
},
{
"key": "hostStatus",
"values": [
"running"
]
},
{
"key": "hostname",
"values": [
"Usermacbook"
]
},
{
"key": "instanceType",
"values": [
"MacBook Air MacBookAir10,1"
]
},
{
"key": "kernelVersion",
"values": [
"23.2.0"
]
},
{
"key": "linuxDistribution",
"values": [
"macOS 14.2.1"
]
},
{
"key": "operatingSystem",
"values": [
"macOS"
]
},
{
"key": "processorCount",
"values": [
"8"
]
},
{
"key": "systemMemoryBytes",
"values": [
"17179869184"
]
},
{
"key": "trustedAccountId",
"values": [
"4444532"
]
}
],
"type": "HOST"
}
Issue response data
{
"issueId": "MjQwNzIwN3xBUE18QVBQTElDQVRJT058MjIwMzEwNzV8MTA0NzYwNzA5",
"title": "My Issue",
"priority": "CRITICAL",
"state": "ACTIVATED",
"sources": ["My Source"],
"conditionName": ["My Condition"],
"policyName": ["My Policy"],
"activatedAt": "2022-01-01T00:00:00Z"
}

Mapping Result

The combination of the sample payload and the Ocean configuration generates the following Port entity:

Service (Entity) entity in Port (Click to expand)
{
"identifier": "MTIzNDU2Nzg5fElORlJBfE5BfDY1MjQwNDc0NjE4MzUyMDkwOTU=",
"title": "UserMacbook",
"blueprint": "newRelicAlert",
"team": [],
"icon": "NewRelic",
"properties": {
"has_apm": false,
"link": "https://one.eu.newrelic.com/redirect/entity/MTIzNDU2Nzg5fElORlJBfE5BfDY1MjQwNDc0NjE4MzUyMDkwOTU=",
"open_issues_count": null,
"reporting": true,
"tags": [
{
"key": "account",
"values": [
"Account 4444831"
]
},
{
"key": "accountId",
"values": [
"4444831"
]
},
{
"key": "agentName",
"values": [
"Infrastructure"
]
},
{
"key": "agentVersion",
"values": [
"1.50.0"
]
},
{
"key": "coreCount",
"values": [
"8"
]
},
{
"key": "fullHostname",
"values": [
"usermacbook"
]
},
{
"key": "hostStatus",
"values": [
"running"
]
},
{
"key": "hostname",
"values": [
"Usermacbook"
]
},
{
"key": "instanceType",
"values": [
"MacBook Air MacBookAir10,1"
]
},
{
"key": "kernelVersion",
"values": [
"23.2.0"
]
},
{
"key": "linuxDistribution",
"values": [
"macOS 14.2.1"
]
},
{
"key": "operatingSystem",
"values": [
"macOS"
]
},
{
"key": "processorCount",
"values": [
"8"
]
},
{
"key": "systemMemoryBytes",
"values": [
"17179869184"
]
},
{
"key": "trustedAccountId",
"values": [
"4444532"
]
}
],
"domain": "INFRA",
"type": "HOST"
},
"relations": {},
"createdAt": "2024-2-6T09:30:57.924Z",
"createdBy": "hBx3VFZjqgLPEoQLp7POx5XaoB0cgsxW",
"updatedAt": "2024-2-6T11:49:20.881Z",
"updatedBy": "hBx3VFZjqgLPEoQLp7POx5XaoB0cgsxW"
}
Issue entity in Port(Click to expand)
{
"identifier": "My Issue",
"title": "My Issue",
"blueprint": "newRelicAlert",
"team": [],
"icon": "NewRelic",
"properties": {
"priority": "CRITICAL",
"state": "ACTIVATED",
"sources": ["My Source"],
"conditionName": ["My Condition"],
"alertPolicyNames": ["My Policy"],
"activatedAt": "2022-01-01T00:00:00Z"
},
"relations": {
"newRelicService": "My Service"
},
"createdAt": "2024-2-6T09:30:57.924Z",
"createdBy": "hBx3VFZjqgLPEoQLp7POx5XaoB0cgsxW",
"updatedAt": "2024-2-6T11:49:20.881Z",
"updatedBy": "hBx3VFZjqgLPEoQLp7POx5XaoB0cgsxW"
}