Skip to content

v0 [4/7]: Android — Kotlin core, Nitro adapter, native-first init - #22

Merged
adhorodyski merged 6 commits into
v0from
stack/2-android
Nov 25, 2026
Merged

adhorodyski merged 6 commits into
v0from
stack/2-android

Conversation

@adhorodyski

@adhorodyski adhorodyski commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • Core (android/src/main/java/com/callstack/otel/core): reads Nitro's seam structs directly and wraps them as lazy ReadableSpan/SpanData, config, endpoint + headers (underscore-host fallback), explicit parenting, sticky init (R16)
  • Adapter: HybridOtel + public RNOtel helpers (RNOtel.start)
  • Consumer R8 rules for minifying apps; otel API exposed as api
  • *.android.otlp.json expected files, compared by the device e2e in v0 [6/7]: example apps (bare, Expo) and device and web e2e #24. No host-side native replay: android/core-jvm, the fast-jvm stage, the hand-off fixtures and the seam runner are removed (the device e2e runs every scenario against the same files).

Verified locally

bun verify static fast-js: 34 + 47 tests green; :react-native-open-telemetry:compileReleaseKotlin green.

Not in this PR

The example app wiring and device runs land in #24.

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

  1. minSdk 26.
  2. Expected files: the *.android.otlp.json files need your review. Two of them (nest-raf, event-emitter-listener) were drafted from device runs.

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
adhorodyski changed the base branch from stack/1-js-sdk to stack/1c-scenarios November 25, 2026 16:26
@adhorodyski adhorodyski changed the title v0 [2/5]: Android — Kotlin core, Nitro adapter, native-first init v0 [4/7]: Android — Kotlin core, Nitro adapter, native-first init Nov 25, 2026
@adhorodyski
adhorodyski added this pull request to stack #28 November 25, 2026 18:49
@adhorodyski
adhorodyski force-pushed the stack/2-android branch 2 times, most recently from af46b6e to 4efb1a0 Compare November 25, 2026 18:56
@adhorodyski
adhorodyski force-pushed the stack/2-android branch 2 times, most recently from cb3e67a to d11d57d Compare November 25, 2026 19:04
Base automatically changed from stack/1c-scenarios to v0 November 25, 2026 19:20
@adhorodyski
adhorodyski marked this pull request as ready for review November 25, 2026 19:20
adhorodyski and others added 4 commits November 25, 2026 20:21
…irst init

Layer 2 of the v0 stack (squashed from v0-impl, PR #20):
- core (android/src/core): seam spans as lazy ReadableSpan/SpanData, config, endpoint and headers, explicit parenting, sticky init (R16)
- adapter: HybridOtel and the public RNOtel helpers (RNOtel.start native-first init)
- consumer R8 rules for minifying apps; the otel API exposed as `api`
- android/core-jvm + verify stage fast-jvm: every hand-off fixture through the Kotlin core into a collector, compared to *.android.otlp.json

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drops `tracesUrl` (`/v1/traces` appending), matching the JS SDK: `export.url` and the JS-fallback `exportUrl` go 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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…radle wrapper

- AttributesTest: only the beyond-long bound. NaN, ±Infinity, -0, 2^53+2 and int/double arrays are already pinned by
  the odd-attributes and rich-span fixtures that FixtureExportTest replays.
- ParentingTest: one round trip that also checks the parent is not remote; no otel-java tracer to re-test that a
  child takes its parent's ids.
- InitTest: dropped the invalid-URL loop (EndpointTest and aFailedInitIsSticky cover it) and the null-config-after-
  init case (the same branch as initializing twice).
- android/core-jvm has no Gradle wrapper of its own: fast-jvm runs example/android/gradlew (same Gradle 9.4.1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every replayed scenario also runs on the Android and iOS devices and compares against the same
`.android.otlp.json` / `.ios.otlp.json` files, so the host-side replay duplicated it. Removes:
- android/core-jvm (the JVM test project and its tests) and the fast-jvm stage;
- the fast-swift stage and its CI job (the Swift tests themselves go in the iOS layer);
- verify/fixtures (hand-off payloads), the fixture encoder and its test, the replay harness and the `seam` runner
  (handoff-basic, odd-attributes and export-headers are e2e-only);
- v0's tracer-bullet e2e, which handed off the rich-span fixture.
The NativeHandOffProcessor unit tests stay, in verify/jest/handoff.test.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With no JVM tests, the core no longer needs to stay free of Nitro: SeamModel.kt (a hand-kept copy of the seam
types) and HybridOtel's 1:1 mapping are gone. JsSpanData wraps the Nitro SeamSpan, `attributesOf` reads Nitro's
AttrValue, and CoreConfig takes otel `Attributes`. The core moves into src/main (no extra source set).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adhorodyski
adhorodyski merged commit 1b433d1 into v0 Nov 25, 2026
@adhorodyski
adhorodyski deleted the stack/2-android branch November 25, 2026 20:41
@adhorodyski adhorodyski added this to the Alpha milestone Nov 26, 2026
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