• /
  • EnglishEspañolFrançais日本語한국어Português
  • 로그인지금 시작하기

사용자의 편의를 위해 제공되는 기계 번역입니다.

영문본과 번역본이 일치하지 않는 경우 영문본이 우선합니다. 보다 자세한 내용은 이 페이지를 방문하시기 바랍니다.

문제 신고

복잡한 NRQL 알림

표준 알림으로는 포착할 수 없는 이상 징후를 감지하기 위해 시간 범위별로 NRQL 결과를 비교합니다.

요구 사항:

주요 작업: newrelic.nrdb.query, newrelic.notification.sendEmail

사용 사례: 다음과 같은 경우 표준 알림이 요구 사항을 충족할 수 없을 때 이 패턴을 사용하십시오.

  • 여러 시간대에 걸쳐 비교
  • 쿼리 결과에 사용자 지정 수학 연산 적용
  • 특정 확률, 한계 또는 패턴이 감지될 때만 트리거됩니다.
  • 조건부 논리를 사용하여 여러 쿼리의 데이터를 결합합니다.
name: Complex_Alert_Workflow
description: 'Compares NRQL results across time windows and sends alerts when new events are detected'
workflowInputs:
destinationId:
type: String
query:
type: String
defaultValue: 'FROM Span SELECT count(*)'
steps:
- name: query1
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: "${{ .workflowInputs.query }} SINCE 10 minutes ago UNTIL 5 minutes ago"
accountIds:
- 7401815
selectors:
- name: length
expression: '[ .results[] | length ]'
- name: count
expression: '[ .results[0].count ]'
- name: query2
type: action
action: newrelic.nrdb.query
version: 1
inputs:
query: "${{ .workflowInputs.query }} SINCE 5 minutes ago"
accountIds:
- 7401815
selectors:
- name: length
expression: '[ .results[] | length ]'
- name: count
expression: '[ .results[0].count ]'
- name: CheckForNewEvents
type: switch
switch:
- condition: >-
${{ (.steps.query2.outputs.count - .steps.query1.outputs.count) > 0 }}
next: sendEmail
next: end
- name: sendEmail
type: action
action: newrelic.notification.sendEmail
version: 1
inputs:
destinationId: ${{ .workflowInputs.destinationId }}
subject: Hello there!
message: >-
More spans incoming!!!
There are --- ${{ (.steps.query2.outputs.count - .steps.query1.outputs.count) }} ---
new Spans that were ingested in the last 5 minutes
attachments:
- type: QUERY
query: ${{ .workflowInputs.query }} SINCE 5 minutes ago
format: CSV
filename: span_count.csv
next: end

일정을 예약하려면 cron 표현식 */10 * * * * (10분마다)과 함께 CreateSchedule API를 사용하십시오. 최소 간격은 10분입니다. 자세한 내용은 워크플로우 제한을 참조하세요.

무엇 향후 계획

Copyright © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.