• /
  • EnglishEspañolFrançais日本語한국어Português
  • Inicia sesiónComenzar ahora

Te ofrecemos esta traducción automática para facilitar la lectura.

En caso de que haya discrepancias entre la versión en inglés y la versión traducida, se entiende que prevalece la versión en inglés. Visita esta página para obtener más información.

Crea una propuesta

RCA de alerta con Autopilot y Slack

|View as Markdown (English)

Cuando se activa una alerta, active Autopilot para ejecutar un análisis de causa raíz y publicar los hallazgos directamente en un canal de Slack. Si Autopilot no devuelve una respuesta utilizable, el flujo de trabajo envía un aviso de error en su lugar para que el equipo sepa que debe investigar manualmente.

Antes de usar este flujo de trabajo, asegúrese de tener:

  • Un ID de problema de alerta de New Relic en formato UUID
  • Un destino de Slack configurado en New Relic — consulte Crear destinos
  • El UUID del destino y el nombre del canal de Slack objetivo

Sugerencia

Al activar este flujo de trabajo desde los flujos de trabajo de alertas, use {{ issueId }} como valor para la entrada issueId. Esta variable pasa automáticamente el ID del problema de la alerta desencadenante al flujo de trabajo.

Este flujo de trabajo completa los siguientes pasos:

  1. Envía un mensaje inicial de Slack para confirmar la alerta y avisar al equipo que el RCA está en marcha
  2. Ejecuta Autopilot con un símbolo de análisis de causa raíz limitado al ID del problema de la alerta
  3. Comprueba si Autopilot devolvió una respuesta utilizable
  4. En caso de éxito: reformatea la respuesta como bloques de Slack Block Kit y publica los hallazgos en Slack si Autopilot tiene éxito.
  5. En caso de falla: publica un mensaje de error con el ID del problema si Autopilot falla.

Este flujo de trabajo usa newrelic.autopilot.run y 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

Descripción general de Autopilot

Aprenda cómo Autopilot investiga alertas e incidentes

Lógica condicional

Usar declaraciones de cambio para ramificar en caso de éxito o fracaso

Enviar notificaciones de Slack

Referencia completa para la acción sendSlack

Crear destinos

Configure el destino de Slack requerido por este flujo de trabajo

Copyright © 2026 New Relic Inc.

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