Skip to main content
NewRelic integration plugin for Soundcheck. It provides out-of-box integration with NewRelic by leveraging NewRelic’s NerdGraph API and implements collection of facts from NewRelic’s API’. The purpose of NewRelic Integration plugin is to provide NewRelic-specific fact collection (like entities, policies, SLAs). NewRelic’s integration plugin supports the collection of the following facts:

Prerequisites

Configure NewRelic integration in Backstage

Integrations are configured at the root level of app-config.yaml, here’s an example configuration for NewRelic:
Follow the instructions for full details on configuration.

Add the NewRelicFactCollector to Soundcheck

First add the package:
Then add the following to your packages/backend/src/index.ts file:
packages/backend/src/index.ts
Consult the Soundcheck Backend documentation for additional details on setting up the Soundcheck backend.

Plugin Configuration

Collection of facts is driven by config. To learn more about the config, see the Defining NewRelic Fact Collectors. NewRelic Fact Collector can be configured via YAML or No-Code UI. If you configure it via both YAML and No-Code UI, the configurations will be merged. It’s preferable to choose a single source for the Fact Collectors configuration (either No-Code UI or YAML) to avoid confusing merge results.

No-Code UI Configuration Option

  1. Make sure the prerequisite Configure NewRelic integration in Backstage is completed and NewRelic instance details are configured.
  2. To enable the NewRelic Integration, go to Soundcheck > Integrations > New Relic and click the Configure button. To learn more about the No-Code UI config, see the Configuring a fact collector (integration) via the no-code UI.
NewRelic
Integration

YAML Configuration Option

  1. Create newrelic-facts-collectors.yaml in the root of your Backstage repository and fill in all your NewRelic fact collectors. A simple example NewRelic fact collector is listed below.
Note: this file will be loaded at runtime along with the rest of your Backstage configuration files, so make sure it’s available in deployed environments in the same way as your app-config.yaml files.
  1. Add a soundcheck collectors field to app-config.yaml and reference the newly created newrelic-facts-collectors.yaml

Rate Limiting (Optional)

This fact collector can be rate limited in Soundcheck using the following configuration:
In this example the fact collector is limited to 2000 executions per minute. This fact collector handles 429 rate limit errors from NewRelic. Soundcheck will automatically wait and retry requests that are rate limited.

Defining NewRelic Fact Collectors

This section describes the data shape and semantics of NewRelic Fact Collectors.

Overall Shape Of A NewRelic Fact Collector

The following is an example of a descriptor file for a NewRelic Fact Collector:
See below for details about these fields.

baseUrl [optional]

The base URL of the NewRelic instance to use. If not provided, the plugin will attempt to use the default URL https://api.newrelic.com.

apiKey [optional]

The NewRelic apiKey to use for authentication.

collects [required]

An array describing which facts to collect and how to collect them. See below for details about the overall shape of a fact collector.

Overall Shape Of A Fact Collector

Each collector supports the fields described below.

type [required]

The type of the collector (e.g. entity, entity-search, policies-search).

frequency [optional]

The frequency at which the fact collection should be executed. Possible values are either a cron expression { cron: ... } or HumanDuration. If provided it overrides the default frequency provided at the top level. If not provided it defaults to the frequency provided at the top level. If neither collector’s frequency nor default frequency is provided the fact will only be collected on demand. Example:

initialDelay [optional]

The amount of time that should pass before the first invocation happens. Possible values are either a cron expression { cron: ... } or HumanDuration. Example:

batchSize [optional]

The number of entities to collect facts for at once. Optional, the default value is 1. Note: Fact collection for a batch of entities is still considered as one hit towards the rate limits by the Soundcheck Rate Limiting engine, while the actual number of hits will be equal to the batchSize. Example:

filter [optional]

A filter specifying which entities to collect the specified facts for. Matches the filter format used by the Catalog API. If provided it overrides the default filter provided at the top level. If not provided it defaults to the filter provided at the top level. If neither collector’s filter nor default filter is provided the fact will be collected for all entities. See filters for more details.

exclude [optional]

Entities matching this filter will be skipped during the fact collection process. Can be used in combination with filter. Matches the filter format used by the Catalog API.

cache [optional]

If the collected facts should be cached, and if so for how long. Possible values are either true or false or a nested { duration: HumanDuration } field. If provided it overrides the default cache config provided at the top level. If not provided it defaults to the cache config provided at the top level. If neither collector’s cache nor default cache config is provided the fact will not be cached. Example:

Entity configuration

In your catalog-info.yaml add the following metadata annotation to allow the plugin to map an entity to an entity in NewRelic.
  • To lookup entity-guid on NewRelic go to All Entities, click on the entity, then click on Metadata and copy the guid.
  • To lookup account-id on NewRelic go to All Entities, click on the entity, then click on Metadata and copy the account id. Note that one organization can have multiple accounts and therefore multiple ids. Be sure copy the right one for the entity.
  • To tag an entity on NewRelic to All Entities, click on the entity, then click on Tags and add a tag. Note tags must be in key:value format, for example backstage:service-name.

Collecting Entity Fact

Entity fact contains information about entity from NewRelic NerdGraph Entity API. The query structure is shown below:

Shape of A Entity Fact Collector

The shape of a Entity Fact Collector matches the Overall Shape Of A NewRelic Fact Collector (restriction: type: entity). The following is an example of the Entity Fact Collector config:

Shape of A Entity Fact

The shape of a Entity Fact is based on the Fact Schema. For a description of the data collected regarding entities, refer to the NerdGraph query. The following is an example of the collected Entity Fact:

Shape of A Entity Fact Check

The shape of an Entity Fact Check matches the Shape of a Fact Check. The following is an example of the Entity fact checks:
The following is an example of the Soundcheck track that utilizes these checks:
The following is an example response from the Entity Fact collector.

Collecting Entity Search Fact

An entity search fact contains information about entity search from NewRelic NerdGraph Entity Search API. The query structure is shown below:

Shape of A Entity Search Fact Collector

The shape of an Entity Search Fact Collector matches the Overall Shape Of A NewRelic Fact Collector (restriction: type: entity-search). The following is an example of the Entity Search Fact Collector config:

Shape of A Entity Search Fact

The shape of a Entity Search Fact is based on the Fact Schema. For a description of the data collected regarding entity search, refer to the NerdGraph query. The following is an example of the collected Entity Search Fact:

Shape of A Entity Search Fact Check

The shape of a Entity Search Fact Check matches the Shape of a Fact Check. The following is an example of the Entity Search fact checks:
The following is an example of the Soundcheck track that utilizes these checks:
The following is an example response from the Entity Search Fact collector.

Collecting Policies Search Fact

A policies search fact contains information about policies search from NewRelic NerdGraph Policies Search API. The query structure is shown below:

Shape of A Policies Search Fact Collector

The shape of a Policies Search Fact Collector matches the Overall Shape Of A NewRelic Fact Collector (restriction: type: policies-search). The following is an example of the Policies Search Fact Collector config:

Shape of A Policies Search Fact

The shape of a Policies Search Fact is based on the Fact Schema. For a description of the data collected regarding policies search, refer to the NerdGraph query. The following is an example of the collected Policies Search Fact:

Shape of A Policies Search Fact Check

The shape of a Policies Search Fact Check matches the Shape of a Fact Check. The following is an example of the Policies Search fact checks:
The following is an example of the Soundcheck track that utilizes these checks:
The following is an example response from the Policies Search Fact collector.

Shape of A NewRelic Track

The following is an example of the Soundcheck track that utilizes these checks