Skip to content

v0 [5/7]: iOS — Swift core, Nitro adapter, two pods, Expo config plugin - #23

Draft
adhorodyski wants to merge 3 commits into
stack/2-androidfrom
stack/3-ios
Draft

adhorodyski wants to merge 3 commits into
stack/2-androidfrom
stack/3-ios

Conversation

@adhorodyski

@adhorodyski adhorodyski commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Core (ios/Core): seam spans into SpanData, config, endpoint + headers (envVarHeaders, gzip), explicit parenting, sticky init (R16)
  • Adapter: HybridOtel + public RNOtel helpers
  • Two pods (R24): ReactNativeOpenTelemetryCore + the Nitro adapter; app.plugin.js adds the Core pod line for Expo
  • Package.swift + fast-swift stage; *.ios.otlp.json expected files
  • static: Swift packageVersion must match package.json

Verified locally

bun verify static fast-js fast-swift: 26 Swift tests, 16 fixtures match their ios files.

Not in this PR

Pod install / app build of the adapter is first proven in #24.

Decisions for you (defaults applied; override with spec: comments)

  1. iOS output gaps:
    • The opentelemetry-swift 2.6 encoder never writes span and link flags or traceState, or the scope schemaUrl. This is recorded as a limitation; the encoder is not reimplemented.
    • Times are quantized to about 240 ns.
    • An iOS TRACEPARENT environment variable becomes the parent of every root span (upstream behaviour).
  2. Two pods (R24). Apps add pod 'ReactNativeOpenTelemetryCore' to their Podfile; Expo apps get the line from app.plugin.js.
    • This conflicts with the spec rule "nothing essential may depend on a config plugin".
    • Autolinking picks between the two root podspecs by sort order, because RN CLI 20.2 and Expo 58 ignore podspecPath.
    • The alternative is to move the Core podspec out of the package root.
  3. Supported platforms: RN 0.79 doesn't build for iOS on Xcode 27 (an fmt compile error). The README says only Xcode 27 with RN 0.88.1 is verified. Should the iOS minimum RN go up?
  4. Expected files: the *.ios.otlp.json files need your review.
  5. Background flush trigger: the flush starts on willResignActive, not didEnterBackground (second commit). Spec §9.4 says "when the app goes to background". willResignActive comes earlier and also fires for transient interruptions such as Control Center or a call; the extra flush there is harmless.

Part of the v0 stack that replaces #20 for review, bottom-up: #21 context → #26 SDK → #27 JS scenarios → #22 Android → #23 iOS → #24 examples + e2e → #25 ops. Review fixes land as new commits on the layer they belong to, and the layers above are rebased. History before the split: v0-impl / #20. Nothing publishes: release runs only after CI on main, and the npm environment does not exist yet.

🤖 Generated with Claude Code

adhorodyski and others added 3 commits November 25, 2026 19:36
…ds and the Expo config plugin

Layer 3 of the v0 stack (squashed from v0-impl, PR #20):
- core (ios/Core): seam spans built into SpanData, config, endpoint and headers (envVarHeaders, gzip), explicit parenting, sticky init (R16)
- adapter: HybridOtel and the public RNOtel helpers (RNOtel.start native-first init)
- ReactNativeOpenTelemetryCore pod + the Nitro adapter pod (R24); app.plugin.js adds the Core pod line for Expo
- Package.swift + verify stage fast-swift: every hand-off fixture through the Swift core, compared to *.ios.otlp.json
- static: the Swift packageVersion must match package.json

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under CPU load a backgrounded app can be starved for ~15 s despite its background task: the export request stalls
until the app is reopened, which is the background-flush e2e failure on CI. Reproduced locally under load (about half
of first attempts failed, 14.8 s stalls); with willResignActive 12 of 12 passed first try.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops `tracesUrl` and its test, matching JS and Android: `export.url` goes to the OTLP exporter unchanged. The
fixture replay passes the collector's `/v1/traces` URL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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