For the complete documentation index, see llms.txt. This page is also available as Markdown.

Create a New Relic Metrics health source for AI Verify

Connect New Relic to AI Verify (v2) to collect and analyze metrics during deployments using manual NRQL queries.

AI Verify (v2) supports a New Relic Metrics health source type that lets you connect a New Relic connector to your deployment pipeline and analyze metrics during deployment verification. New Relic currently supports the Metrics feature only; a native Logs health source for New Relic is not yet available. You configure a New Relic Metrics health source using Manual Setup, where you write the NRQL query yourself and map the fields the AI analysis engine needs.

What you will learn from this topic


Before you begin


Create a New Relic Metrics health source

Navigate to Account/Org/Project Settings, then select Health Sources from the left navigation. Click + New Health Source to open the configuration wizard.

1

Configure the overview

On the Overview tab, provide the basic health source details.

Click to view full size image
  1. Enter a Health Source Name, for example, newrelic-prod-metrics.

  2. In Select health source type, select the New Relic tile.

  3. In Select Connector, choose the New Relic connector that points to your New Relic account.

  4. In Select Feature, the dropdown shows Metrics as the only option. A native Logs health source is not yet supported for New Relic.

  5. Under Setup Approach, select Manual Setup. AI-assisted setup is not currently available for New Relic Metrics health sources.

  6. Click Continue.

2

Define the query specification

The Query Specifications tab is where you configure the NRQL query that fetches metrics from New Relic. Each health source can have one or more named queries.

The left panel lists your queries. Click + Add Query to add additional queries. Select a query in the list to edit its settings in the right panel.

Query Name and identifier

Enter a human-readable Query Name, for example, Checkout Service Latency. Harness derives the query identifier automatically. The identifier must be unique within the health source.

New Relic Group Name

Enter a New Relic Group Name for the query, or select an existing group to add this query to it. The group name is required and is used to organize related queries in the analysis results.

NRQL query

Enter an NRQL query that returns a metric time series, for example a SELECT average(...) FROM Metric TIMESERIES query. If your query includes a TIMESERIES clause but no FACET clause, Harness automatically adds FACET host to the query before running it, so the plugin can distinguish metric values per host. If your query already has its own FACET clause, Harness leaves it unchanged.

Click Run Query to execute the query against your New Relic connector. Harness displays the returned response in the Records section.

3

Map metric fields

After the query returns a record, map the fields the AI analysis engine needs. Each field takes an absolute path from the root of the record, written in bracket notation: object keys in single quotes and array positions as numbers, with segments joined by dots. For example, ['results'].[0].['average'].

Field
Required
Description

Metric Value JSON Path

Yes

Path to the numeric metric value in the response

Timestamp Field/Locator JSON Path

Yes

Path to the timestamp for each metric value

Service Instance Identifier

Yes

Path to the field that identifies which host or service instance the metric value belongs to, typically the faceted host attribute

To select a path interactively, click the + icon next to a field. A path picker opens, showing the parsed record returned by Run Query. Click any value in the tree to fill in its path. You can also type the path directly, but it must use the bracket notation shown above.

Click Build Chart to preview the metric as a time series chart using the mapped Metric Value JSON Path and Timestamp Field/Locator JSON Path. This step is optional but lets you confirm the field mapping is correct before saving.

4

Save the health source

Click Save to create the health source. The health source appears on the Health Sources listing page with a Metric signal-type badge and New Relic as the type.

The health source is now ready to reference in an AI Verify (v2) step.

New Relic Metrics health sources always aggregate query results using the AVG aggregation type. There is no option to select a different aggregation.


Add multiple queries

New Relic Metrics health sources support multiple queries within a single health source. You might add multiple queries to cover different metrics from the same New Relic connector, for example, one query for latency and another for error rate. Use the New Relic Group Name field to organize related queries into the same group in the analysis results.

In the Query Specifications tab, click + Add Query to add a new query entry in the left panel. Each query has its own name, group, NRQL query, and field mapping. All queries in the health source run as part of the same AI Verify step execution.


Use the health source in an AI Verify pipeline

Reference the New Relic Metrics health source by its identifier in the AIVerifyNG step. During execution, the step first fetches baseline metrics using the saved NRQL query, then fetches post-deployment (canary) metrics during the deployment window, and submits both sets to the AI analysis engine for comparison.

Kubernetes rolling deployment with New Relic Metrics health source: full YAML

View analysis results

After the pipeline runs, click the AI Verify step in the execution view. The Analysis tab shows a result for the New Relic Metrics health source. Click the health source entry to see its Query Summaries section, which lists each query with a healthy or unhealthy badge.

When a query is marked unhealthy, the analysis displays a summary of the detected anomalous metric patterns and a root cause hypothesis. This output is generated by the AI analysis engine, which compares the baseline metric window against the post-deployment metric window.

The Logs tab in the execution view shows the raw plugin output, including the baseline metric fetch, the canary (post-deployment) metric fetch, and the call to the AI Verify agent that produces the health summary.


Next steps

Last updated

Was this helpful?