whatwg / html

HTML Standard
https://html.spec.whatwg.org/multipage/
Other
7.85k stars 2.57k forks source link

[Proposal] Capturing Real User Monitoring (RUM) #10383

Open hemanth opened 1 month ago

hemanth commented 1 month ago

What problem are you trying to solve?

Proposal for window.realUserMetrics

Capturing Real User Monitoring (RUM) for Enhanced Application Performance Insight

Background

Understanding how real users experience your web application is crucial for improving performance and user satisfaction. Real User Monitoring (RUM) provides invaluable insight into frontend performance from the perspective of actual users. By correlating user journeys with synthetic tests, backend metrics, traces, logs, and network performance data, RUM enables the detection of poor user experiences and facilitates rapid issue resolution with comprehensive context from across the stack.

What Are You Trying to Solve?

The proposed window.realUserMetrics API aims to address several challenges faced by web developers and application operators in capturing and analyzing real user metrics:

  1. Limited Visibility into User Experience: Without real user metrics, developers have limited visibility into how users interact with their applications, making it difficult to identify performance bottlenecks and user experience issues.

  2. Fragmented Monitoring Data: Existing tools often provide synthetic performance data or backend metrics in isolation, lacking a seamless correlation with actual user interactions. This fragmentation makes it challenging to get a holistic view of application performance.

  3. Inefficient Issue Detection and Resolution: Without real user data, detecting and resolving performance issues can be slow and imprecise. Developers need a way to quickly identify and understand issues from the user's perspective.

  4. Lack of Contextual Information: Resolving performance issues effectively requires context from various parts of the stack, including frontend, backend, network, and logs. A unified approach is needed to provide this comprehensive context.

Use Cases

The window.realUserMetrics API will enable the following scenarios:

  1. Performance Monitoring:

    • Requirement: Collect real-time performance data from user interactions.
    • Benefit: Provides insights into load times, responsiveness, and other key performance indicators (KPIs) from the user's perspective.
  2. User Experience Analysis:

    • Requirement: Track user journeys and correlate them with performance metrics.
    • Benefit: Identifies patterns and trends in user behavior, highlighting areas for improvement.
  3. Issue Detection and Debugging:

    • Requirement: Detect performance issues in real time and provide detailed context for debugging.
    • Benefit: Facilitates quick and effective resolution of performance issues, improving overall user experience.
  4. Comprehensive Monitoring:

    • Requirement: Correlate real user metrics with synthetic tests, backend metrics, traces, logs, and network data.
    • Benefit: Provides a holistic view of application performance, enabling deeper insights and more accurate problem resolution.

Conclusion

The window.realUserMetrics API addresses a critical need for capturing and analyzing real user metrics, providing comprehensive insight into application performance from the user's perspective. By focusing on key requirements and leveraging lessons from existing monitoring tools, we can introduce a robust and secure API that enhances the web platform's capabilities. This proposal aims to gather feedback and iterate towards a solution that meets developer needs while ensuring user privacy and performance efficiency.

What solutions exist today?

None

How would you solve it?

Requirements

To meet these use cases, the window.realUserMetrics API must provide the following capabilities:

Implementation Proposal

  1. API Design

    • window.realUserMetrics.startTracking(options)
      • options can include:
        • metrics: Specific performance metrics to track (e.g., load time, time to interactive).
        • sessionID: Identifier for the user session.
    • window.realUserMetrics.stopTracking()
      • Stops the tracking of performance metrics.
    • window.realUserMetrics.getMetrics()
      • Retrieves the collected performance data for analysis.
  2. Security Considerations

    • Implement user consent prompts and privacy safeguards.
    • Ensure data is anonymized and securely stored.
    • Provide clear opt-out options for users.
  3. Performance Considerations

    • Optimize for minimal impact on browser performance.
    • Ensure data collection is efficient and does not interfere with user experience.

Anything else?

No response

flashymittens commented 1 month ago

As a user I don’t think I need a browser to do more spying on me… It’s already a privacy mess. Stop adding stuff like this, pretty please? And opt‐out is never enough, since most users will have no idea it’s happening in the first place.