# 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%'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.arkannis.net/monitoring/new-relic/nrql-alerts-examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
