Skip to content

Commit

Permalink
Removed spaces preceding code blocks because this breaks images.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhetoric101 committed Jul 12, 2021
1 parent 28216f8 commit a7527e5
Showing 1 changed file with 11 additions and 11 deletions.
Expand Up @@ -549,31 +549,31 @@ You can alert on StatsD data using [NRQL alert conditions](/docs/alerts/new-reli

First, send this data to New Relic’s StatsD container:

```
echo "prod.test.num:32|g" | nc -v -w 1 -u localhost 8125
```
```
echo "prod.test.num:32|g" | nc -v -w 1 -u localhost 8125
```

Next, create a [NRQL alert condition](/docs/alerts/new-relic-alerts/defining-conditions/create-alert-conditions-nrql-queries) using this query:

```
SELECT latest(prod.test.num) FROM Metric WHERE metricName = 'prod.test.num'
```
```
SELECT latest(prod.test.num) FROM Metric WHERE metricName = 'prod.test.num'
```

Here's an image showing creating this NRQL alert condition. Notice that the sample data sent in is represented by the blue dot on the upper right of the chart.

![StatsD NRQL alert condition query](./images/statsd-nrql-alert-condition-example.png "statsd-nrql-alert-condition-example.png")

Now we can create the alert condition with these settings:

![StatsD NRQL alert condition creation](./images/statsd-nrql-alert-condition-example-2.png "statsd-nrql-alert-condition-example-2.png")
![StatsD NRQL alert condition creation example](./images/statsd-nrql-alert-condition-example-2.png "StatsD NRQL alert condition creation example")

Remember to set the **Condition name**.
When you create the NRQL alert condition, be sure to set the **Condition name**.

If a metric with a value above 50 is sent, then an incident is created and notified. The incident is closed automatically after 24 hours. To test that the alert is working, run this command:

```
echo "prod.test.num:60|g" | nc -v -w 1 -u localhost 8125
```
```
echo "prod.test.num:60|g" | nc -v -w 1 -u localhost 8125
```
</Collapser>
</CollapserGroup>

Expand Down

0 comments on commit a7527e5

Please sign in to comment.