feat(telemetry): add typed Sentry telemetry model and bootstrap#324
Merged
provencher merged 1 commit intoJul 2, 2026
Conversation
This was referenced Jun 29, 2026
Collaborator
Author
90179cb to
c6ba672
Compare
d17e5a0 to
531da8a
Compare
d9519dd
into
cameroncooke/sentry-01-build-plumbing
6 of 7 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds the data-minimization core: a closed typed telemetry model and the bootstrap that initializes Sentry and exposes the emit primitives. This is the privacy boundary expressed in code.
Stack: 2/10 · depends on PR 1 · Refs GH-183
What this changes
SentryTelemetryModel.swift— closed enums (Category,Action,Transaction,Metric,SpanOperation,Attribute, plusModelFamily/ProviderKind/ToolName/TokenBudgetBucket…). NoAttributecase accepts an arbitraryString.SentryTelemetryBootstrap.swift— the only file thatimports Sentry (gated).start()+addBreadcrumb/increment/gauge/distributionMilliseconds/trace/spanprimitives.Business rules (the privacy boundary)
999_999, so an internal count can't become a precise fingerprint.ToolName(rawValue:)returnsnil).ModelFamily/ProviderKind; token sizes bucketed intoTokenBudgetBucket.start()config is conservative:sendDefaultPii = false; session replay, MetricKit, structured logs, auto network/file-IO/CoreData/auto-perf tracing all off;maxBreadcrumbs = 50,maxCacheItems = 30; only crashes, uncaught NSExceptions, and app-hangs auto-captured.tracesSampleRate1 (debug) / 0.3 (prod).Attribute.allowedKeysset + the singletelemetryData(from:)funnel guarantee every emit path (breadcrumb/span/metric) is allow-listed identically.Key decisions
SentryTelemetryBootstrapenum, so the two files are one type and must ship together (this is why the PR is ~740 LOC and indivisible).@autoclosureso a disabled build never even constructs the array (zero overhead).trace/spanhelpers tagis_errorand finish spans;#elsepassthroughs make them transparent when telemetry is compiled out.Note on size
~740 LOC, over the 500 target, but irreducible: splitting would either break the single-type relationship or change the final bytes.
Test plan