Skip to content

Enhanced CrUX Metrics Export - #75

Merged
smartinov merged 1 commit into
mainfrom
feature/enhanced-crux-metrics
Oct 22, 2025
Merged

Enhanced CrUX Metrics Export#75
smartinov merged 1 commit into
mainfrom
feature/enhanced-crux-metrics

Conversation

@smartinov

@smartinov smartinov commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds Chrome UX Report (CrUX) metrics export including category distribution ratios and Core Web Vitals thresholds while maintaining full backward compatibility.

What Changed

New Metrics Added

For each Core Web Vital metric (LCP, INP, CLS, FCP, TTFB), the exporter now provides:

  1. Category Distribution Ratios - Proportion of real users experiencing fast/average/slow performance

    pagespeed_loading_experience_metrics_largest_contentful_paint_category_ratio{category="fast"} 0.9389
    pagespeed_loading_experience_metrics_largest_contentful_paint_category_ratio{category="average"} 0.0371
    pagespeed_loading_experience_metrics_largest_contentful_paint_category_ratio{category="slow"} 0.0240
    
  2. Core Web Vitals Thresholds - Google's performance boundaries extracted from API data

    pagespeed_loading_experience_metrics_largest_contentful_paint_threshold_duration_seconds{threshold="good"} 2.5
    pagespeed_loading_experience_metrics_largest_contentful_paint_threshold_duration_seconds{threshold="poor"} 4.0
    

Add comprehensive Chrome UX Report (CrUX) metrics export including:
- Category distribution ratios (fast/average/slow proportions)
- Core Web Vitals thresholds extracted from API bucket boundaries
- Full backward compatibility maintained

Changes:
- collector/collector.go: Enhanced collectLoadingExperience() to export
  category_ratio and threshold metrics for all CrUX metrics (LCP, INP,
  CLS, FCP, TTFB)
- README.md: Added CrUX Metrics section with comprehensive documentation
- CLAUDE.md: Updated metrics documentation with new metric types

All metrics handle proper unit conversions (ms to seconds, CLS hundredths
to decimal) and gracefully handle missing data.
@smartinov
smartinov force-pushed the feature/enhanced-crux-metrics branch from c14193c to 8107f9d Compare October 22, 2025 14:00
@smartinov
smartinov merged commit 4aa6e3f into main Oct 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant