Skip to content

feat(metrics): Add MetricKit integration reporting all metrics via Sentry#136

Merged
philprime merged 1 commit into
mainfrom
feat/metrickit-metrics-integration
Jun 10, 2026
Merged

feat(metrics): Add MetricKit integration reporting all metrics via Sentry#136
philprime merged 1 commit into
mainfrom
feat/metrickit-metrics-integration

Conversation

@philprime

Copy link
Copy Markdown
Member

Subscribe to both MXMetricPayload and MXDiagnosticPayload via a new
MetricKitManager singleton and report every extractable value as Sentry
custom metrics using SentrySDK.metrics.count/distribution/gauge.

All metric names and types were verified against the actual MetricKit SDK
headers in Xcode 26.5, including new iOS 26 APIs (MXDiskSpaceUsageMetric,
MXAnimationMetric.hitchTimeRatio).

Metrics reported from MXMetricPayload:

  • CPU: cumulative time + instruction count
  • GPU: cumulative time
  • App runtime: foreground, background, background audio, background location
  • Network transfer: wifi/cellular upload/download
  • App launch: time to first draw, resume time, optimized first draw, extended launch (histograms)
  • App responsiveness: hang time (histogram)
  • Disk I/O: cumulative logical writes
  • Memory: peak usage (gauge), average suspended (gauge)
  • Display: average pixel luminance (gauge)
  • Animation: scroll hitch time ratio, hitch time ratio (iOS 26)
  • Cellular condition: signal bars (histogram)
  • App exit reasons: 6 foreground + 10 background exit counters
  • Disk space usage (iOS 26): binary/data file sizes and counts, cache, clone, total used/capacity

Metrics reported from MXDiagnosticPayload:

  • CPU exceptions: count + total CPU time + total sampled time
  • Disk write exceptions: count + total writes caused
  • Hangs: count + duration
  • Crashes: count
  • App launch diagnostics: count + launch duration

A Sentry dashboard with 27 widgets was also created to visualize all metrics:
https://techprimate.sentry.io/dashboard/6875364/

…ntry

Subscribe to MXMetricPayload and MXDiagnosticPayload and report all
available values as Sentry custom metrics (count/distribution/gauge).

Covers CPU, GPU, app runtime, network transfer, launch times, memory,
animation, disk I/O, display, cellular condition, location activity,
app exit reasons (foreground + background), disk space usage (iOS 26),
and all diagnostic types (crashes, hangs, CPU/disk exceptions, launch).
@philprime philprime marked this pull request as ready for review June 10, 2026 17:39
@philprime philprime enabled auto-merge (squash) June 10, 2026 17:42
@sentry

sentry Bot commented Jun 10, 2026

Copy link
Copy Markdown

📲 Install Builds

iOS

🔗 App Name App ID Version Configuration
Flinky com.techprimate.Flinky 1.1.5 (2) --

⚙️ flinky Build Distribution Settings

@philprime philprime merged commit 674498b into main Jun 10, 2026
7 checks passed
@philprime philprime deleted the feat/metrickit-metrics-integration branch June 10, 2026 18:12
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