Pular para o conteúdo principal
Estes exemplos mostram como as ferramentas do AppSignal MCP se combinam para tarefas comuns. Para os parâmetros de cada ferramenta, veja a Referência de ferramentas do MCP.

Investigando um erro de produção

  1. Liste as exceções abertas recentes: “Show me all open incidents in production from the last 24 hours”
  2. Obtenha detalhes completos sobre um incidente específico: “Get the details for incident #847 including the stack trace”
  3. Puxe traces para ver o que aconteceu no nível do código: “Get the error traces for incident #847”
  4. Documente seus achados: “Add a note to incident #847: investigated the database timeout — connection pool was exhausted during peak traffic”
  5. Resolva-o: “Close incident #847”

Verificando o que um deploy quebrou

  1. Liste os erros introduzidos pelo último deploy: “Which new errors did the last deploy to MyStore production introduce?”
  2. Verifique um deploy específico: “Show only the new errors from deploy a1b2c3d”
  3. Investigue um deles: “Get the details and error traces for incident #912”
  4. Verifique novamente mais tarde: “Have any new errors appeared since 09:00 UTC today?”

Analisando uma action lenta

  1. Obtenha uma visão geral de performance: “Which actions are slowest in the web namespace right now?”
  2. Puxe traces para o pior caso: “Get traces for BlogPostsController#index from the last hour”
  3. Inspecione a árvore de spans para encontrar o gargalo: “Show me the full span tree for trace abc123”
  4. Investigue um span específico: “Get the details for span def456 in trace abc123”
  5. Restrinja os traces por uma tag: “Show only the BlogPostsController#index traces tagged with user_id 4321”

Fazendo triagem de um lote de incidentes

  1. “Find all open incidents in the background namespace from the last week”
  2. “Narrow that to incidents whose exception or action name matches ‘Timeout*’”
  3. “Mark incidents #120, #121, and #122 as work in progress and assign them to Jana”
  4. “Close all incidents related to ActionMailer — they were fixed in the last deploy”

Pesquisando logs durante um incidente

  1. “Find all error logs from the last hour”
  2. “Show me logs where message contains ‘timeout’ on web-1 between 14:00 and 15:00”
  3. “Get fatal logs from the payments source over the last 30 minutes”

Contando linhas de log por campo

  1. “Which request paths logged the most errors in the last hour?”
  2. “How many 500 responses did each host log today?”
  3. “Count this morning’s checkout logs by severity”
O AppSignal faz a contagem, então seu agente não precisa ler cada linha. Ele pode agrupar por qualquer campo de log e somar ou calcular a média de campos numéricos. Para uma contagem que você verifica com frequência, peça ao seu agente para transformá-la em uma ação de log line de métricas para que você possa criar gráficos ou alertas com ela.

Reconstruindo a jornada de um cliente

Quando um usuário reporta que algo deu errado, a resposta geralmente está espalhada por logs de várias fontes, além de erros e traces. Um agente pode costurar essa linha do tempo para você.
  1. “Get all logs for user.id=4321 from production over the last 24 hours, across every source”
  2. “Narrow that to the window between 14:00 and 15:30 UTC and group the results by source”
  3. “List any open exception incidents from production in that same window — anything tagged with user.id=4321?”
  4. “For incident #903, pull the error traces and walk the span tree”
  5. “Summarize what happened: which actions did this user hit, what failed, and where did the error originate?”
Isso usa get_log_lines, get_exception_incidents e get_traces em uma única conversa. A etapa final de resumo é onde o MCP entrega valor — o agente compõe a narrativa, e não você.

Configurando processamento de logs

O AppSignal executa ações em linhas de log durante a ingestão, na ordem que você definir. Um padrão comum é emitir uma métrica, criar um gatilho e depois filtrar — isso garante que o AppSignal capture o sinal antes de descartar a linha de log.
  1. Verifique as ações de log line existentes e sua ordem: use get_app_resources com sections: ["log_line_actions"]
  2. “Create a metrics action that counts log lines where severity is error as log.error_count”
  3. “Add a trigger action that fires an alert when severity is fatal”
  4. “Add a filter to drop all health check log lines”
  5. “Reorder those actions so the metrics action runs first, then the trigger, then the filter”

Verificando uma métrica ao longo do tempo

  1. “Show the error count per hour for the last day on MyStore production”
  2. “Show memory per minute for each host over the last two hours”
  3. “Show memory for each host over the last six hours, and point out any periods without data”
Veja get_metrics_timeseries para saber o que o resultado contém e quais intervalos você pode pedir.

Detectando um job agendado que parou de rodar

  1. “List the cron check-ins on MyStore production”
  2. “Show the recent runs for the nightly-export check-in, and which of them were missed or late”
  3. “Create a cron check-in for daily-invoices that runs at 02:00 UTC with a 15-minute grace period, and notify the payments-oncall notifier”

Configurando um monitor de uptime

  1. “Monitor our URL https://api.example.com/health from Europe and North America, and alert the payments-oncall notifier when it’s down. Call the monitor API health.”
  2. “Add an Authorization header to the API health monitor and set a two-minute warm-up”
  3. “What was the uptime of the API health monitor over the last 24 hours?”
  4. “Delete the old staging health check monitor”
O uptime não é armazenado como um valor. O AppSignal verifica cada URL uma vez por minuto, e o agente calcula o uptime a partir das falhas contabilizadas em uptime_monitor_error_count.

Descobrindo onde uma verificação de uptime gasta seu tempo

  1. “Why is the API health uptime check slow from Europe? Show how long each step of the check took over the last hour”
  2. “Compare that across all regions. Which step differs the most?”
Seu agente divide cada verificação em etapas, como a consulta do nome de domínio, a conexão e a espera pela resposta do servidor. Veja temporização da requisição para todas as etapas.

Criando um gatilho de Anomaly detection

  1. Descubra as métricas disponíveis: “What metrics are available for my production app?”
  2. Verifique as tags disponíveis: “What tags are available for response_time?”
  3. Crie o gatilho: “Create a trigger that fires when mean response time exceeds 500ms for more than 5 minutes, and notify the Slack #alerts channel”
  4. Arquive um gatilho antigo depois de substituído: use get_triggers para encontrar o ID primeiro, depois “Archive the old response_time trigger”

Construindo um dashboard de monitoramento

  1. “What metrics are available for my production app?”
  2. “Create a dashboard called ‘API Health’ in production”
  3. “Add a line chart of p95 response time by action to the API Health dashboard”
  4. “Add an area chart of error rate broken down by namespace”
  5. “Add a Big Number tile showing the mean of response_time, formatted as a duration”