---
title: Cannot create alert condition for infrastructure integration
source: https://docs.newrelic.com/docs/infrastructure/amazon-integrations/troubleshooting/cannot-create-alert-condition-infrastructure-integration
---

## Problem

You can't create an [infrastructure alert condition](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/infrastructure-alert-conditions/infrastructure-alerts-add-edit-or-view-host-alert-information) because the metric you want to alert on does not appear in the **Define thresholds** section of our infrastructure UI's alerts page.

## Solution

Instead of using New Relic's infrastructure UI, use [infrastructure REST API calls](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/infrastructure-alert-conditions/rest-api-calls-new-relic-infrastructure-alerts) to create the alert condition.

1.  Review the [query syntax to create (POST)](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/infrastructure-alert-conditions/rest-api-calls-new-relic-infrastructure-alerts#post-conditions) an infrastructure condition.
2.  Review the [API requirements for metric conditions](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/infrastructure-alert-conditions/rest-api-calls-new-relic-infrastructure-alerts#metric-api).
3.  When you create the condition: For the `select_value` field, build the metric name by using the following syntax, where `provider` is a standard prefix string:

    ```
    provider.metric.aggregation_type
    ```

    -   `metric`: Use the metric name as described in the New Relic documentation for your integration.
    -   `aggregation_type` Use `Sum`, `Average`, `Minimum`, or `Maximum`. Refer to the original documentation by the integration's cloud provider to see which statistic aggregations are available for each metric.
4.  For the `policy_id` field, use the unique ID for the condition's associated alert policy. To find the policy ID, open the policy in [one.newrelic.com](https://one.newrelic.com), click the **(i)** icon, and read the value from the policy ID tag.

## Cause

This happens because the **Define thresholds** dropdown list in our infrastructure UI only shows the metrics that New Relic has been able to collect in the last hour.
