• /
  • EnglishEspañolFrançais日本語한국어Português
  • ログイン今すぐ開始

この機械翻訳は、参考として提供されています。

英語版と翻訳版に矛盾がある場合は、英語版が優先されます。詳細については、このページを参照してください。

問題を作成する

AutopilotとSlackを使用した集計RCA

集計が発生したときに、Autopilotをトリガーして根本原因分析を実行し、その結果を直接Slackチャンネルに投稿します。Autopilotが使用可能な応答を返さない場合、チームが手動で調査する必要があることを把握できるように、ワークフローは代わりにエラー通知を送信します。

このワークフローを使用する前に、以下のことを確認してください:

  • UUID形式のNew Relic集計のイシューID
  • New Relicで設定されたSlackの宛先 — 宛先の作成を参照してください
  • 宛先のUUIDとターゲットのSlackチャンネル名

このワークフローでは、次の手順を完了します:

  1. 集計を認識し、RCAが進行中であることをチームに知らせるための最初のSlackメッセージを送信します
  2. 集計課題IDをスコープとした根本原因分析プロンプトを使用してAutopilotを実行します
  3. Autopilotが使用可能な応答を返したかどうかを確認します。
  4. 成功時: Autopilotが成功した場合、応答をSlack Block Kitブロックとして再フォーマットし、結果をSlackに投稿します。
  5. 失敗時:Autopilotが失敗した場合、問題IDを含むエラーメッセージを投稿します。

このワークフローはnewrelic.autopilot.runを使用し、 newrelic.notification.sendSlack

name: autopilotSlackRCA
description: Automatically analyze New Relic alerts with Autopilot and send cleanly formatted findings to Slack
workflowInputs:
issueId:
type: String
required: true
validations:
- errorMessage: Must be a valid New Relic issue ID in UUID format
pattern: '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$'
type: regex
slackDestinationId:
type: String
required: true
validations:
- pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
errorMessage: "Invalid format. Please provide a valid UUID."
type: regex
channel:
type: String
required: true
steps:
- name: notifyAlertReceived
type: action
action: newrelic.notification.sendSlack
version: 1
inputs:
destinationId: ${{ .workflowInputs.slackDestinationId }}
channel: ${{ .workflowInputs.channel }}
text: |-
🔔 *Alert Received — Starting Root Cause Analysis*
⏳ Running Autopilot for RCA, please wait...
- name: runAutopilot
type: action
action: newrelic.autopilot.run
version: 1
inputs:
prompt: >-
Perform a root cause analysis for the following New Relic alert:
Issue ID: ${{ .workflowInputs.issueId }}
Provide your comprehensive analysis including Summary, Root Cause, and Remediation Actions.
selectors:
- name: agentResponse
expression: .response.finalAnswer
ignoreErrors: true
- name: checkAgentResponse
type: switch
switch:
- condition: ${{ (.steps.runAutopilot.outputs.agentResponse // "") != "" }}
next: buildSlackBlocks
next: sendAutopilotError
- name: buildSlackBlocks
type: assign
inputs:
blocks: '${{ (.steps.runAutopilot.outputs.agentResponse // "") as $r | (if ($r|type)=="string" then ($r | try fromjson catch null) else $r end) as $json | (if ($json|type)=="array" then ($json[0].text // ($json | tostring)) elif ($json|type)=="object" and ($json.card.body|type)=="array" then [ $json.card.body[] | if .type=="Text" then (.value // "") else "" end ] | join("\n\n") elif ($json|type)=="object" and ($json.text|type)=="string" then $json.text else ($r | tostring) end) | gsub("\\*\\*"; "*") | gsub("### "; "*") | gsub("## "; "*") as $text | ([ $text / "\n" ]) as $lines | [ { "type": "header", "text": { "type": "plain_text", "text": "✅ Autopilot RCA Complete" } }, { "type": "divider" } ] + [ $lines[][] | select(. != "") | { "type": "section", "text": { "type": "mrkdwn", "text": . } } ] }}'
next: sendRcaFindings
- name: sendRcaFindings
type: action
action: newrelic.notification.sendSlack
version: 1
inputs:
destinationId: ${{ .workflowInputs.slackDestinationId }}
channel: ${{ .workflowInputs.channel }}
blocks: ${{ .steps.buildSlackBlocks.outputs.blocks }}
next: end
- name: sendAutopilotError
type: action
action: newrelic.notification.sendSlack
version: 1
inputs:
destinationId: ${{ .workflowInputs.slackDestinationId }}
channel: ${{ .workflowInputs.channel }}
text: |-
🟥 *Autopilot RCA Failed*
Could not extract findings from Autopilot response for issue: ${{ .workflowInputs.issueId }}
Please investigate manually.
next: end

Autopilotの概要

Autopilotがアラートとインシデントを調査する方法について学習します

コンディショナル・ロジック

switch文を使用して、成功または失敗に応じて分岐します。

Slack通知の送信

sendSlackアクションの完全なリファレンス

目的地を作成する

このワークフローで必要なSlackの送信先を設定します。

Copyright © 2026 New Relic株式会社。

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