Skip to content

docs(apple): Document MetricKit diagnostic and metric options - #20365

Open
itaybre wants to merge 5 commits into
masterfrom
itaybre/docs/apple-metrickit-options
Open

itaybre wants to merge 5 commits into
masterfrom
itaybre/docs/apple-metrickit-options

Conversation

@itaybre

@itaybre itaybre commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

DESCRIBE YOUR PR

Document the MetricKit options shipped in Cocoa 9.31.0 to 9.35.0, and move the MetricKit docs from Extended Configuration to their own section under Features. The MetricKit page only described enableMetricKit and hang diagnostics, and the options page didn't list the experimental MetricKit options.

New MetricKit section under Features

/platforms/apple/configuration/metric-kit/ becomes /platforms/apple/metric-kit/, with a redirect from the old URL. The section has an overview page and two subpages:

  • App Hangs and Other Diagnostic Reports keeps the hang diagnostics and flame graph content from docs(apple): Explain MetricKit hang diagnostics #20022 and adds options.experimental.metrickit.enabledDiagnosticReports with the available reports, their mechanism.type and platforms, how the option interacts with enableMetricKit, and the note that .crash and .memoryException can report events the SDK's crash handler and watchdog termination tracking already reported, which the SDK tries to deduplicate. The links to Apple's documentation point to the new MetricKit API. It also covers the raw payload attachment and that events from earlier runs carry the app and OS versions of that time without the current scope.
  • Metric Reports documents enabledMetricReports for Swift and SentryObjC with every metric name, type, unit and availability, the metric attributes, the reports only MetricManager provides on iOS and macOS 27, and how histograms are sent as distributions.

Options page and feature lists

The options page lists the three experimental MetricKit options and drops the outdated note that MetricKit lets the SDK apply the current scope. The visionOS feature list no longer says MetricKit is unavailable, and the macOS list no longer says it's enabled by default. Links to the MetricKit page point to the new section.

The deduplication of MetricKit crashes (getsentry/sentry-cocoa#9584) isn't released yet, so the note needs the SDK version once it ships.

Fixes COCOA-2037
Fixes getsentry/sentry-cocoa#9279

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace YYYY-MM-DD with the due date. You can update this information later by editing the PR description.

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've supplied a deadline.

Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

EXTRA RESOURCES

Cover enabledDiagnosticReports, enabledMetricReports and
hangReportingMode, list the metric reports with their names, types
and units, and explain how delayed MetricKit data is reported.
Fix the visionOS and macOS feature lists.

Fixes COCOA-2037
@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-docs Ready Ready Preview Nov 19, 2026 9:11pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Preview Nov 19, 2026 9:11pm UTC

Request Review

@linear-code

linear-code Bot commented Oct 30, 2026

Copy link
Copy Markdown

COCOA-2037

@codeowner-assignment
codeowner-assignment Bot requested a review from a team October 30, 2026 20:19
@github-actions github-actions Bot added the Priority: Needs Triage The PR description is missing valid priority information label Oct 30, 2026
@codeowner-assignment
codeowner-assignment Bot requested review from NinjaLikesCheez and philprime and removed request for a team October 30, 2026 20:19
Document the memory exception diagnostic, the MetricManager
reports on xOS 27, the metric reports in SentryObjC, the animation
and Metal reports, the histogram reports and the diagnostic
environment attributes.
MetricKit sat under Extended Configuration as a single page. Move
it to its own section under Features, with one page for app hangs
and other diagnostic reports and one for metric reports. The old
URL redirects to the new section.
Point the diagnostic links to the MetricKit types that replace the
MX-prefixed ones, and link MetricManager. Replace the crash and
memory exception warnings with one note that the SDK tries to
deduplicate these events, but some can show up twice.
@cursor

cursor Bot commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Getting ready to monitor this change · Rollout details

Status Service Environment
⏳ Getting ready to monitor this change

@codeowner-assignment
codeowner-assignment Bot requested a review from a team November 20, 2026 18:51
@github-actions github-actions Bot added Priority: Normal Docs review has no urgent deadline and removed Priority: Needs Triage The PR description is missing valid priority information labels Nov 20, 2026
Comment on lines +110 to +114
Flame graph attachments are subject to these limits:

- Attachments count toward your attachment quota, and the associated hang events count toward your error-event quota. No profiling quota is consumed. Attachment retention and access permissions apply.
- Each attachment is limited to 10 MiB. If the SDK cannot create it, for example because sample counts are invalid or the payload exceeds this limit, it falls back to storing the tree in the event's stack trace.
- Sentry symbolicates at most the first 2,500 frame entries in an attachment. Additional frames remain in the graph but may be unresolved. Missing debug information can also leave frames unresolved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: We should add a reference to the specification so these don't become magic numbers


## Delayed Data

MetricKit reports data after it was recorded. It delivers diagnostic reports on the next launch of the app.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m: This is not true. MetricKit can report diagnostic reports in the same lifespan of the app it happened in. We should rephrase this that MetricKit provides historic data both for the current and previous runs

[MetricKit](https://developer.apple.com/documentation/metrickit) is Apple's framework for the diagnostics and metrics the operating system collects about your app on your users' devices. The MetricKit integration converts two kinds of MetricKit data:

- **Diagnostic reports**, such as app hangs, CPU and disk write exceptions, or slow app launches, become Sentry error events. Learn more in <PlatformLink to="/metric-kit/diagnostic-reports/">App Hangs and Other Diagnostic Reports</PlatformLink>.
- **Metric reports**, such as CPU time, network transfer, memory and app exit counts, become <PlatformLink to="/metrics/">Sentry metrics</PlatformLink>. Learn more in <PlatformLink to="/metric-kit/metric-reports/">Metric Reports</PlatformLink>.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m I think our product name is "Application Metric" not "Sentry metric"


## Volume and Attributes

MetricKit delivers metric payloads about once a day, so metrics can arrive up to a day after the values were recorded. Each enabled report adds up to one metric per payload, except for [histogram reports](#histogram-reports), which add up to about 100. Metrics count towards your metrics quota. Counts of zero aren't sent. Every metric is placed in the middle of the payload's reporting interval and carries these attributes:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

l: We could reference Apple docs here:

MetricKit collects metric data continuously and delivers a MetricReport about the previous 24 hours. The MetricReport is delivered, at most, once per day when conditions permit. [....] MetricKit delivers each DiagnosticReport immediately after the event occurs, so you can respond to crashes, hangs, and other diagnostic events without waiting for the daily metric report.

https://developer.apple.com/documentation/metrickit/monitoring-app-performance-with-metrickit#Understand-the-reporting-model

This branch was successfully deployed

2 active (1 outdated) deployments
Preview – sentry-docs — c7209c33 Deployed Nov 19, 2026 by vercel[bot]
Preview – develop-docs — 20c5ad0d Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document the MetricKit diagnostic and metric options

2 participants