# Observability Newrelic

> New Relic APM and monitoring. Use when running NRQL queries, checking application performance, error rates, or throughput via New Relic.

- **Type:** Skill
- **Install:** `agentstack add skill-swapnildahiphale-opensre-observability-newrelic`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [swapnildahiphale](https://agentstack.voostack.com/s/swapnildahiphale)
- **Installs:** 0
- **Category:** [Cloud & Infrastructure](https://agentstack.voostack.com/c/cloud-infrastructure)
- **Latest version:** 0.1.0
- **License:** Apache-2.0
- **Upstream author:** [swapnildahiphale](https://github.com/swapnildahiphale)
- **Source:** https://github.com/swapnildahiphale/OpenSRE/tree/main/sre-agent/.claude/skills/observability-newrelic
- **Website:** https://opensre.in

## Install

```sh
agentstack add skill-swapnildahiphale-opensre-observability-newrelic
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# New Relic Observability

## Authentication

**IMPORTANT**: Credentials are injected automatically by a proxy layer. Do NOT check for `NEWRELIC_API_KEY` in environment variables - it won't be visible to you. Just run the scripts directly; authentication is handled transparently.

Configuration environment variables you CAN check (non-secret):
- `NEWRELIC_ACCOUNT_ID` - New Relic account ID
- `NEWRELIC_BASE_URL` - API base URL (proxy mode)

---

## Available Scripts

All scripts are in `.claude/skills/observability-newrelic/scripts/`

### query_nrql.py - Run NRQL Queries (START HERE)
```bash
python .claude/skills/observability-newrelic/scripts/query_nrql.py --account-id ACCOUNT_ID --query "SELECT average(duration) FROM Transaction SINCE 1 hour ago"
```

### get_apm_summary.py - APM Summary
```bash
python .claude/skills/observability-newrelic/scripts/get_apm_summary.py --account-id ACCOUNT_ID --app-name MyApp [--time-range 30m]
```

---

## NRQL Query Reference

```sql
-- Response time
SELECT average(duration) FROM Transaction WHERE appName = 'MyApp' SINCE 1 hour ago

-- Throughput
SELECT count(*) FROM Transaction WHERE appName = 'MyApp' SINCE 1 hour ago TIMESERIES 5 minutes

-- Error rate
SELECT percentage(count(*), WHERE error = true) FROM Transaction WHERE appName = 'MyApp' SINCE 1 hour ago

-- Apdex score
SELECT apdex(duration, t: 0.5) FROM Transaction WHERE appName = 'MyApp' SINCE 1 hour ago

-- Slowest transactions
SELECT average(duration), count(*) FROM Transaction WHERE appName = 'MyApp' SINCE 1 hour ago FACET name LIMIT 10

-- Database query time
SELECT average(databaseDuration) FROM Transaction WHERE appName = 'MyApp' SINCE 1 hour ago TIMESERIES

-- External service calls
SELECT average(externalDuration), count(*) FROM Transaction WHERE appName = 'MyApp' SINCE 1 hour ago FACET externalTransactionName
```

---

## Investigation Workflow

### Application Performance Issue
```
1. get_apm_summary.py --account-id  --app-name  (overview)
2. query_nrql.py --query "SELECT average(duration) FROM Transaction WHERE appName = '' SINCE 1 hour ago TIMESERIES 5 minutes"
3. query_nrql.py --query "SELECT percentage(count(*), WHERE error = true) FROM Transaction WHERE appName = '' SINCE 1 hour ago TIMESERIES 5 minutes"
```

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [swapnildahiphale](https://github.com/swapnildahiphale)
- **Source:** [swapnildahiphale/OpenSRE](https://github.com/swapnildahiphale/OpenSRE)
- **License:** Apache-2.0
- **Homepage:** https://opensre.in

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-swapnildahiphale-opensre-observability-newrelic
- Seller: https://agentstack.voostack.com/s/swapnildahiphale
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
