Alerts Conditions

Create

🔥🔥 New users should use <a href="https://docs.newrelic.com/docs/alerts-applied-intelligence/new-relic-alerts/advanced-alerts/alerts-nerdgraph/nerdgraph-api-examples/">these docs about managing alerts via NerdGraph.</a>

<p>This API endpoint allows you to create APM Application and Key Transaction, Browser and Mobile application metric conditions for your alert policies.</p> <p><strong>Conditions for web transaction percentiles, or conditions targeting labels (dynamic targeting), are not available.</strong></p> <p>Note: <a href="https://docs.newrelic.com/docs/apis/rest-api-v2/requirements/rest-api-key">Admin User’s API Key</a> is required.</p> <p>See our documentation for a discussion on <a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/rest-api-calls-new-relic-alerts#conditions-create" target="_blank">creating conditions for policies</a>. <br /></p> <p>All fields are required except for “runbook_url”, “enabled” (defaults to false), “user_defined”.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#type" target="_blank">type</a>: apm_app_metric, apm_kt_metric, servers_metric, browser_metric, mobile_metric.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#name" target="_blank">name</a>: A title for your condition.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#enabled" target="_blank">enabled</a>: The status of your condition (optional).</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#entities" target="_blank">entities</a>: An array of instance IDs associated with your condition.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#metric" target="_blank">metric</a>: The metric field accepts parameters based on the condition <b>type</b> selected as follows:</p> <p>  When <b>apm_app_metric</b>: apdex, error_percentage, response_time_web, response_time_background, throughput_web, throughput_background, user_defined.</p> <p>  When <b>apm_kt_metric</b>: apdex, error_percentage, error_count, response_time, throughput.</p> <p>  When <b>servers_metric</b>: cpu_percentage, disk_io_percentage, memory_percentage, fullest_disk_percentage, load_average_one_minute, user_defined.</p> <p>  When <b>browser_metric</b>: end_user_apdex, total_page_load, page_rendering, web_application, network, dom_processing, request_queuing, ajax_response_time, page_views_with_js_errors, page_view_throughput, ajax_throughput, user_defined.</p> <p>  When <b>mobile_metric</b>: database, images, json, network, view_loading, network_error_percentage, status_error_percentage, mobile_crash_rate, user_defined.</p> <p><a href="https://docs.newrelic.com/docs/alerts/rest-api-alerts/new-relic-alerts-rest-api/alerts-conditions-api-field-names#condition-scope">condition_scope</a>: Set to either <code>instance</code> to target a Java application instance or <code>application</code> for a Java app.</p> <p><a href="https://docs.newrelic.com/docs/alerts/rest-api-alerts/new-relic-alerts-rest-api/alerts-conditions-api-field-names#violation_close_timer">violation_close_timer</a> (in hours): 1, 2, 4, 8, 12, 24. Duration after which instance-based (including JVM health metric) violations will automatically close.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#runbook_url" target="_blank">runbook_url</a>: Runbook URL to display in notifications (optional).</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#terms_duration" target="_blank">terms[duration]</a> (in minutes): 5, 10, 15, 30, 60, 120.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#terms_operator" target="_blank">terms[operator]</a>: above, below, equal.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#terms_priority" target="_blank">terms[priority]</a>: critical, warning.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#terms_threshold" target="_blank">terms[threshold]</a>: Must be 0 or greater.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#terms_time_function" target="_blank">terms[time_function]</a>: all, any.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#user_defined_metric" target="_blank">user_defined[metric]</a>: A custom metric to be evaluated.</p> <p><a href="https://docs.newrelic.com/docs/alerts/new-relic-alerts/rest-api-alerts/alerts-conditions-api-field-names#user_defined_value_function" target="_blank">user_defined[value_function]</a>: average, min, max, total, sample_size.</p>
post/alerts_conditions/policies/{policy_id}.json

Request

Path parameters

policy_idinteger required

Alerts policy ID

Request body

Response

No response was specified

Changes

No recorded changes to this operation across all 1 revision of this API.