analyze-performance

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Analyze Performance Issues

分析性能问题

Name

名称

sentry:analyze-performance - Analyze performance metrics and identify slow transactions in Sentry
sentry:analyze-performance - 分析Sentry中的性能指标并识别慢事务

Synopsis

概要

/analyze-performance [arguments]
/analyze-performance [arguments]

Description

描述

Analyze performance monitoring data in Sentry to identify slow transactions, bottlenecks, and performance regressions.
分析Sentry中的性能监控数据,以识别慢事务、瓶颈和性能退化问题。

Implementation

实现说明

This command helps you investigate performance issues and optimize application speed using Sentry's performance monitoring data.
该命令可帮助你利用Sentry的性能监控数据调查性能问题并优化应用运行速度。

Usage

使用方法

/analyze-performance [project-name] [timeframe]
/analyze-performance [project-name] [timeframe]

What This Command Does

该命令的功能

  1. Asks for the Sentry project name
  2. Requests timeframe for analysis
  3. Fetches performance metrics using Sentry MCP tools
  4. Analyzes transaction performance data
  5. Provides insights on:
    • Slowest transactions and endpoints
    • Performance trends over time
    • Transaction throughput (requests/min)
    • Apdex scores
    • P50, P95, P99 latency percentiles
    • Database query performance
    • External API call latency
  6. Identifies performance regressions and anomalies
  7. Suggests optimization opportunities
  1. 询问Sentry项目名称
  2. 请求分析的时间范围
  3. 使用Sentry MCP工具获取性能指标
  4. 分析事务性能数据
  5. 提供以下维度的洞察:
    • 最慢的事务和端点
    • 随时间变化的性能趋势
    • 事务吞吐量(请求/分钟)
    • Apdex评分
    • P50、P95、P99延迟百分位数
    • 数据库查询性能
    • 外部API调用延迟
  6. 识别性能退化和异常情况
  7. 给出优化建议

Prerequisites

前提条件

  • Sentry MCP server must be installed and configured
  • OAuth authentication with Sentry must be completed
  • Performance monitoring enabled for the project
  • Access to the target Sentry project
  • 必须安装并配置Sentry MCP服务器
  • 已完成与Sentry的OAuth认证
  • 项目已启用性能监控
  • 拥有目标Sentry项目的访问权限

Example Interaction

示例交互

User: /analyze-performance backend-api 7d

Claude: Analyzing performance metrics for backend-api over the last 7 days...
用户: /analyze-performance backend-api 7d

Claude: 正在分析backend-api项目过去7天的性能指标...

Performance Analysis Report

性能分析报告

Overview

概述

  • Total Transactions: 2.4M
  • Avg Throughput: 4,000 req/min
  • Apdex Score: 0.78 (Fair)
  • Time Range: Last 7 days
  • 总事务数: 240万
  • 平均吞吐量: 4000 请求/分钟
  • Apdex评分: 0.78(一般)
  • 时间范围: 过去7天

Slowest Transactions (P95 Latency)

最慢事务(P95延迟)

  1. POST /api/users/search
    • P50: 450ms
    • P95: 3,200ms
    • P99: 8,500ms
    • Throughput: 120 req/min
    • Issue: Database query scanning full table
  2. GET /api/reports/generate
    • P50: 890ms
    • P95: 2,800ms
    • P99: 5,400ms
    • Throughput: 45 req/min
    • Issue: Large data aggregation without caching
  3. POST /api/images/upload
    • P50: 320ms
    • P95: 2,100ms
    • P99: 4,200ms
    • Throughput: 200 req/min
    • Issue: S3 upload latency varies by region
  1. POST /api/users/search
    • P50: 450ms
    • P95: 3200ms
    • P99: 8500ms
    • 吞吐量: 120 请求/分钟
    • 问题: 数据库查询扫描全表
  2. GET /api/reports/generate
    • P50: 890ms
    • P95: 2800ms
    • P99: 5400ms
    • 吞吐量: 45 请求/分钟
    • 问题: 大数据聚合未使用缓存
  3. POST /api/images/upload
    • P50: 320ms
    • P95: 2100ms
    • P99: 4200ms
    • 吞吐量: 200 请求/分钟
    • 问题: S3上传延迟因区域而异

Performance Trends

性能趋势

  • Overall latency increased 15% since v3.1.0 deployment (5 days ago)
  • User search endpoint degraded 40% in last 3 days
  • Database query time increased from 120ms to 180ms average
  • 自v3.1.0版本部署(5天前)以来,整体延迟增加了15%
  • 用户搜索端点在过去3天内性能下降了40%
  • 数据库查询平均时间从120ms增加到180ms

Span Analysis

链路分析(Span Analysis)

Slowest Database Queries:
  1. SELECT * FROM users WHERE email LIKE '%@%' - 1,200ms avg
  2. SELECT * FROM events JOIN users - 850ms avg
  3. UPDATE sessions SET last_seen - 450ms avg
Slowest External Calls:
  1. POST https://api.payment-processor.com/charge - 650ms avg
  2. GET https://cdn.example.com/assets - 280ms avg
最慢数据库查询:
  1. SELECT * FROM users WHERE email LIKE '%@%' - 平均1200ms
  2. SELECT * FROM events JOIN users - 平均850ms
  3. UPDATE sessions SET last_seen - 平均450ms
最慢外部调用:
  1. POST https://api.payment-processor.com/charge - 平均650ms
  2. GET https://cdn.example.com/assets - 平均280ms

Recommendations

优化建议

  1. Critical: Add database index on users.email for search queries
  2. High: Implement Redis caching for report generation
  3. Medium: Consider CDN with multi-region support for uploads
  4. Low: Review payment processor latency (external dependency)
  1. 紧急: 为users.email字段添加数据库索引以优化搜索查询
  2. 高优先级: 为报告生成实现Redis缓存
  3. 中优先级: 考虑使用支持多区域的CDN处理上传
  4. 低优先级: 评估支付处理器的延迟情况(外部依赖)

Next Steps

后续步骤

Would you like me to:
  • Investigate the v3.1.0 regression in detail?
  • Analyze specific slow database queries?
  • Review span performance for a specific transaction?
undefined
你是否需要我:
  • 详细调查v3.1.0版本的性能退化问题?
  • 分析特定的慢数据库查询?
  • 查看特定事务的链路性能详情?
undefined

Arguments

参数

  • project-name
    (optional): Sentry project slug
  • timeframe
    (optional): Time range (1h, 24h, 7d, 30d)
  • project-name
    (可选): Sentry项目标识(slug)
  • timeframe
    (可选): 时间范围(1h、24h、7d、30d)

Tips

提示

  • Focus on P95/P99 latency for user experience impact
  • Look for performance changes after deployments
  • Monitor Apdex score for overall user satisfaction
  • Investigate span-level details for bottlenecks
  • Compare performance across releases and environments
  • Set up performance alerts for regressions
  • 重点关注P95/P99延迟对用户体验的影响
  • 留意部署后的性能变化
  • 监控Apdex评分以了解整体用户满意度
  • 深入分析链路级细节以定位瓶颈
  • 对比不同版本和环境的性能表现
  • 为性能退化设置告警

Related Commands

相关命令

  • /investigate-errors
    : Check for errors related to slow endpoints
  • /check-releases
    : Compare performance across releases
  • /query-events
    : Run custom performance queries
  • /investigate-errors
    : 检查与慢端点相关的错误
  • /check-releases
    : 对比不同版本的性能
  • /query-events
    : 运行自定义性能查询