implementing-real-user-monitoring
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseReal User Monitoring
真实用户监控(RUM)
This skill provides automated assistance for real user monitoring tasks.
本技能可为真实用户监控相关任务提供自动化协助。
Overview
概述
This skill streamlines the process of setting up Real User Monitoring (RUM) for web applications. It guides you through the essential steps of choosing a platform, defining metrics, and implementing the tracking code to capture valuable user experience data.
本技能可简化Web应用的真实用户监控(RUM)搭建流程,引导你完成平台选择、指标定义以及跟踪代码实现的关键步骤,以捕获有价值的用户体验数据。
How It Works
工作原理
- Platform Selection: Helps you consider available RUM platforms (e.g., Google Analytics, Datadog RUM, New Relic).
- Instrumentation Design: Guides you in defining the key performance metrics to track, including Core Web Vitals and custom events.
- Tracking Code Implementation: Assists in implementing the necessary JavaScript code to collect and transmit performance data.
- 平台选择:协助你考量可用的RUM平台(如Google Analytics、Datadog RUM、New Relic)。
- 埋点设计:引导你定义需要跟踪的关键性能指标,包括Core Web Vitals和自定义事件。
- 跟踪代码实现:协助你编写必要的JavaScript代码以收集并传输性能数据。
When to Use This Skill
适用场景
This skill activates when you need to:
- Implement Real User Monitoring on a website or web application.
- Track Core Web Vitals (LCP, FID, CLS) to improve user experience.
- Monitor page load times (FCP, TTI, TTFB) for performance optimization.
当你需要以下服务时,可激活本技能:
- 在网站或Web应用中实现真实用户监控(RUM)。
- 跟踪Core Web Vitals(LCP、FID、CLS)以优化用户体验。
- 监控页面加载时间(FCP、TTI、TTFB)以进行性能优化。
Examples
示例
Example 1: Setting up RUM for a new website
示例1:为新网站搭建RUM
User request: "setup RUM for my new website"
The skill will:
- Guide the user through selecting a RUM platform.
- Provide code snippets for implementing basic tracking.
用户请求:“为我的新网站搭建RUM”
本技能将:
- 引导用户选择RUM平台。
- 提供实现基础跟踪的代码片段。
Example 2: Tracking custom performance metrics
示例2:跟踪自定义性能指标
User request: "I want to track how long it takes users to complete a purchase"
The skill will:
- Help define a custom performance metric for purchase completion time.
- Generate JavaScript code to track the metric.
用户请求:“我想跟踪用户完成购买所需的时间”
本技能将:
- 协助你定义“购买完成时长”这一自定义性能指标。
- 生成用于跟踪该指标的JavaScript代码。
Best Practices
最佳实践
- Privacy Compliance: Ensure compliance with privacy regulations (e.g., GDPR, CCPA) when collecting user data.
- Sampling: Implement sampling to reduce data volume and impact on performance.
- Error Handling: Implement robust error handling to prevent tracking code from breaking the website.
- 隐私合规:收集用户数据时需确保符合隐私法规(如GDPR、CCPA)。
- 数据采样:实现数据采样以减少数据量及对性能的影响。
- 错误处理:完善错误处理逻辑,避免跟踪代码导致网站故障。
Integration
集成
This skill can be used in conjunction with other monitoring and analytics tools to provide a comprehensive view of application performance.
本技能可与其他监控和分析工具结合使用,以全面掌握应用性能情况。
Prerequisites
前置条件
- Access to web application frontend code in {baseDir}/
- RUM platform account (Google Analytics, Datadog, New Relic)
- Understanding of Core Web Vitals metrics
- Privacy compliance documentation (GDPR, CCPA)
- 拥有{baseDir}/目录下的Web应用前端代码访问权限
- 已注册RUM平台账号(Google Analytics、Datadog、New Relic)
- 了解Core Web Vitals指标
- 具备隐私合规文档(GDPR、CCPA)
Instructions
操作步骤
- Select appropriate RUM platform for requirements
- Define key metrics to track (Core Web Vitals, custom events)
- Implement tracking code in application frontend
- Configure data sampling and privacy settings
- Set up dashboards for metric visualization
- Define alerts for performance degradation
- 根据需求选择合适的RUM平台
- 定义需跟踪的关键指标(Core Web Vitals、自定义事件)
- 在应用前端实现跟踪代码
- 配置数据采样及隐私设置
- 搭建指标可视化仪表盘
- 设置性能下降告警规则
Output
输出内容
- RUM implementation code snippets
- Platform configuration documentation
- Custom event tracking examples
- Dashboard definitions for key metrics
- Privacy compliance checklist
- RUM实现代码片段
- 平台配置文档
- 自定义事件跟踪示例
- 关键指标仪表盘定义
- 隐私合规检查清单
Error Handling
错误处理
If RUM implementation fails:
- Verify platform API credentials
- Check JavaScript bundle integration
- Validate metric collection permissions
- Review privacy consent configuration
- Ensure network connectivity for data transmission
若RUM实现失败:
- 验证平台API凭证
- 检查JavaScript包集成情况
- 确认指标收集权限
- 审核隐私授权配置
- 确保数据传输的网络连通性
Resources
参考资源
- Core Web Vitals measurement guide
- RUM platform documentation
- Privacy compliance best practices
- Performance monitoring strategies
- Core Web Vitals 测量指南
- RUM平台官方文档
- 隐私合规最佳实践
- 性能监控策略