newrelic-quickstarts icon indicating copy to clipboard operation
newrelic-quickstarts copied to clipboard

💡 FR - New syntax support for alert conditions

Open thezackm opened this issue 1 year ago • 5 comments

Summary

Requesting support for more natural syntax options surrounding the creation of alert conditions.

Desired Behavior

Using the New Relic UI, creation of alert conditions allows you to copy both a NerdGraph Mutation snippet and a Terraform snippet.

Create alert condition New Relic One 2023-06-01 at 11 11 58 AM

The current workflow for creating a quickstart alert is to manually transcribe an alert from these natural snippets (or the UI itself) into the YAML syntax we require for the backend service to create an alert. Essentially we are having users create an alert in the UI, copy the NerdGraph mutation, transcribe that into YAML, and then we take that YAML and make a NerdGraph mutation 🙃

Possible Solution

Add direct support for users to simply upload a GraphQL file for alert conditions.

Additional context

GraphQL from New Relic UI:

mutation {
  alertsNrqlConditionStaticCreate(
    accountId: <REDACTED>
    policyId: <REDACTED>
    condition: {
      enabled: false
      name:  "Active Directory Replication Failures"
      description:  null
      nrql: {
        query:  "FROM activeDirectoryReplicationPartners SELECT count(*)
        FACET server, partner
        // Finding all entries where the Attempt timestamp != the Success timestamp, indicating a failure
        WHERE lastReplicationSuccess != lastReplicationAttempt"
      }
      expiration: null
      runbookUrl:  null
      signal: {
        aggregationWindow: 60
        fillOption: NONE
        aggregationDelay: 120
        aggregationMethod: EVENT_FLOW
        aggregationTimer: null
        fillValue: null
        slideBy: null
        evaluationDelay: null
      }
      terms: [
        {
          operator: ABOVE
          threshold: 0
          priority: CRITICAL
          thresholdDuration: 120
          thresholdOccurrences: ALL
        }
      ]
      violationTimeLimitSeconds: 86400
    }
  ) {
    id
  }
}

Same alert, in our YAML syntax:

name: Active Directory Replication Failures
description: |+
  This alert is triggered when the Attempt timestamp != the Success timestamp, indicating a failure in replication between domain contollers.
type: STATIC
nrql:
  query: "FROM activeDirectoryReplicationPartners SELECT count(*) FACET server, partner WHERE lastReplicationSuccess != lastReplicationAttempt"

valueFunction: SINGLE_VALUE 
terms:
  - priority: CRITICAL
    operator: ABOVE
    threshold: 0
    thresholdDuration: 120
    thresholdOccurrences: ALL

expiration:
  closeViolationsOnExpiration: false
  openViolationOnExpiration: false
  expirationDuration: null

signal:
  aggregationDelay: 120
  aggregationMethod: EVENT_FLOW
  aggregationTimer: null
  aggregationWindow: 60
  fillOption: NONE
  fillValue: null
  slideBy: null

violationTimeLimitSeconds: 86400

thezackm avatar Jun 01 '23 16:06 thezackm

Old issues will be closed after 105 days of inactivity. This issue has been quiet for 90 days and is being marked as stale. Reply here to keep this issue open.

github-actions[bot] avatar Aug 31 '23 01:08 github-actions[bot]

Still a valid FR

thezackm avatar Aug 31 '23 02:08 thezackm

Old issues will be closed after 105 days of inactivity. This issue has been quiet for 90 days and is being marked as stale. Reply here to keep this issue open.

github-actions[bot] avatar Jan 04 '24 01:01 github-actions[bot]

Still a valid FR

thezackm avatar Jan 17 '24 15:01 thezackm

Old issues will be closed after 105 days of inactivity. This issue has been quiet for 90 days and is being marked as stale. Reply here to keep this issue open.

github-actions[bot] avatar Apr 18 '24 01:04 github-actions[bot]