> For the complete documentation index, see [llms.txt](https://docs.arkannis.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arkannis.net/monitoring/new-relic/nrql-alerts-examples.md).

# NRQL Alerts examples

* NRQL is a custom New Relic Language that is very similar to the SQL Language

### AWS Applications

#### ELB HTTP codes:

```sql
SELECT average(aws.applicationelb.HTTPCode_ELB_5XX_Count) FROM Metric FACET entityName
```

#### ALB HTTP codes:

```sql
SELECT count(`aws.applicationelb.HTTPCode_ELB_5XX_Count`) FROM Metric FACET entityName
```

#### ALB HTTP codes based on name:

```sql
SELECT count(aws.applicationelb.HTTPCode_ELB_5XX_Count) FROM Metric WHERE displayName like '%NAME-HERE%'
```

#### Process Monitoring:

```sql
SELECT * FROM ProcessSample Where processDisplayName where processDisplayName like '%%'
```

```sql
SELECT count(*) FROM ProcessSample FACET entityName where processDisplayName LIKE 'aws-es-proxy'
```

#### RDS Free Space:

```sql
SELECT min(aws.rds.FreeLocalStorage) from Metric FACET entityName
```

#### K8S / EKS:

```sql
SELECT * from K8sClusterSample
```

#### Select from Incidents:

```sql
SELECT * FROM NrAiIncident where conditionName like '%Pod%'
```
