Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ services:
# Ensure Go build cache initializes in a writable, persisted location
# This fixes: "failed to initialize build cache at /.cache/go-build: permission denied"
# and keeps the cache across container restarts (since /app is bind-mounted)
GOMODCACHE: "/app/tmp/go/pkg/mod"
GOCACHE: "/app/tmp/go-build"
GOMODCACHE: "/app/tmp/.go/pkg/mod"
GOCACHE: "/app/tmp/.go-build"
XDG_CACHE_HOME: "/app/tmp"
# Lock Playwright browsers location so install and runtime match
PLAYWRIGHT_BROWSERS_PATH: "/app/tmp/ms-playwright"
Expand Down
181 changes: 181 additions & 0 deletions docs/components/New Relic.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
---
title: "New Relic"
---

Monitor and manage your New Relic resources

## Triggers

<CardGrid>
<LinkCard title="On Issue" href="#on-issue" description="Listen to New Relic issue events" />
</CardGrid>

import { CardGrid, LinkCard } from "@astrojs/starlight/components";

## Actions

<CardGrid>
<LinkCard title="Report Metric" href="#report-metric" description="Send custom metrics to New Relic" />
<LinkCard title="Run NRQL Query" href="#run-nrql-query" description="Execute NRQL queries to retrieve data from New Relic" />
</CardGrid>

## Instructions

To set up New Relic integration:

1. **Select Region**: Choose your New Relic region (US or EU)
2. **Provide API Keys**: You can provide one or both keys depending on which components you need.

## API Keys

New Relic uses two different types of API keys for different purposes:

- **User API Key** (starts with NRAK-): Required for **Run NRQL Query** and **On Issue** trigger. Get it from New Relic > Account Settings > API Keys > Create User Key.
- **License Key** (Ingest - License): Required for **Report Metric** action. Get it from New Relic > Account Settings > API Keys > Create Ingest License Key.

You may provide both keys to enable all components, or just the key(s) for the components you need.

<a id="on-issue"></a>

## On Issue

The On Issue trigger starts a workflow execution when New Relic issues are created or updated.

### Use Cases

- **Incident Response**: automated remediation or notification when critical issues occur.
- **Sync**: synchronize New Relic issues with Jira or other tracking systems.

### Configuration

- **Priorities**: Filter by priority (CRITICAL, HIGH, MEDIUM, LOW). Leave empty for all.
- **States**: Filter by state (ACTIVATED, CLOSED, CREATED). Leave empty for all.

### Webhook Setup

This trigger generates a webhook URL. You must configure a **Workflow** in New Relic to send a webhook to this URL.

**IMPORTANT**: You must use the following JSON payload template in your New Relic Webhook configuration:

```json
{
"issue_id": "{{issueId}}",
"title": "{{annotations.title.[0]}}",
"priority": "{{priority}}",
"issue_url": "{{issuePageUrl}}",
"state": "{{state}}",
"owner": "{{owner}}"
}
```

### Example Data

```json
{
"issueId": "12345678-abcd-efgh-ijkl-1234567890ab",
"issueUrl": "https://one.newrelic.com/launcher/nrai.launcher?pane=eyJuZXJkbGV0SWQiOiJhbGVydGluZy11aS1jbGFzc2ljLmluY2lkZW50cyIsInNlbGVjdGVkSW5jaWRlbnRJZCI6IjEyMzQ1Njc4In0=",
"owner": "Team SRE",
"priority": "CRITICAL",
"state": "ACTIVATED",
"title": "High CPU Usage"
}
```

<a id="report-metric"></a>

## Report Metric

The Report Metric component allows you to send custom metrics (Gauge, Count, Summary) to New Relic.

### Configuration

- **Metric Name**: The name of the metric (e.g., "server.cpu.usage")
- **Metric Type**: The type of metric (Gauge, Count, or Summary)
- **Value**: The numeric value of the metric
- **Timestamp**: Optional Unix timestamp (milliseconds). Defaults to now.
- **Interval (ms)**: Required for Count and Summary metrics. The duration of the measurement window in milliseconds.
- **Attributes**: Optional JSON object with additional attributes

### Output

Returns the sent metric payload.

### Example Output

```json
{
"intervalMs": 0,
"name": "server.cpu.usage",
"status": "202 Accepted",
"timestamp": 1707552000000,
"type": "gauge",
"value": 75.5
}
```

<a id="run-nrql-query"></a>

## Run NRQL Query

The Run NRQL Query component allows you to execute NRQL queries via New Relic's NerdGraph API.

### Use Cases

- **Data retrieval**: Query telemetry data, metrics, events, and logs
- **Custom analytics**: Build custom analytics and reporting workflows
- **Monitoring**: Retrieve monitoring data for downstream processing
- **Alerting**: Query data to make decisions in workflow logic

### Configuration

- **Account**: The New Relic account to query (select from dropdown)
- **Query**: The NRQL query string to execute (required)
- **Timeout**: Query timeout in seconds (optional, default: 10, max: 120)

### Output

Returns query results including:
- **results**: Array of query result objects
- **totalResult**: Aggregated result for queries with aggregation functions
- **metadata**: Query metadata (event types, facets, messages, time window)
- **query**: The original NRQL query executed
- **accountId**: The account ID queried

### Example Queries

- Count transactions: `SELECT count(*) FROM Transaction SINCE 1 hour ago`
- Average response time: `SELECT average(duration) FROM Transaction SINCE 1 day ago`
- Faceted query: `SELECT count(*) FROM Transaction FACET appName SINCE 1 hour ago`

### Notes

- Requires a valid New Relic API key with query permissions
- Queries are subject to New Relic's NRQL query limits
- Invalid NRQL syntax will return an error from the API

### Example Output

```json
{
"accountId": "1234567",
"metadata": {
"eventTypes": [
"Transaction"
],
"facets": null,
"messages": [],
"timeWindow": {
"begin": 1707559740000,
"end": 1707563340000
}
},
"query": "SELECT count(*) FROM Transaction SINCE 1 hour ago",
"results": [
{
"count": 1523
}
],
"totalResult": null
}
```

Loading