Skip to content

spec: metrics as two independent pipelines from one config - #34

Open
adhorodyski wants to merge 1 commit into
v0from
design/metrics
Open

adhorodyski wants to merge 1 commit into
v0from
design/metrics

Conversation

@adhorodyski

Copy link
Copy Markdown
Collaborator

Design only; nothing is implemented. Metrics are built separately after v0 and don't block 0.3.0.

What changes in the spec

  • §4.4 config: exportConfig.url is replaced by one URL per signal: exportConfig: { headers, traces: { url, headers }, metrics: { url, headers, temporalityPreference } }.
    • A signal is on when its URL is set.
    • Headers set for a signal are merged over the shared ones and win on the same key.
    • This is the only breaking change, so it should land in 0.3.0 even if metrics ship later.
  • §4.6 metrics (new):
    • JS metrics: stock sdk-metrics + exporter-metrics-otlp-proto, exported from JS on Android, iOS and web, with the same code everywhere.
    • Native metrics: a stock MeterProvider with PeriodicMetricReader and OtlpHttpMetricExporter in each native core, used through RNOtel.meter.
    • One config, one resource: initialize also returns native's resource and the merged metrics config.
    • No per-measurement seam calls. JS and native never share an instrument.
    • No requests when idle: all three readers skip empty exports.
    • Best effort: the JS background flush, and up to 60 s of JS points lost on a reload. Spans are unaffected.
    • Rejected, with reasons:
      • Native as the only writer behind a JS shim.
      • JS aggregation exported by native. The opentelemetry-swift 2.6 MetricData initializers are internal, so this would need a custom POST.
      • 0.2's model.
  • §9.6 verification (new):
    • a /v1/metrics route on the fake collector
    • one <name>.metrics.otlp.json expected file per scenario; a scenario without one must export no metrics
    • data-point times stripped by the normalizer
    • scenarios: metrics-js, metrics-native, metrics-headers, metrics-off, and background-flush extended to native metrics
  • §2, §10: status and backlog updated.

Open questions (§4.6.9)

  1. Should native add service.instance.id per process start for fleet identity, or should we only document it?
  2. Expose the export interval now, or wait for a request?
  3. Keep temporalityPreference?

🤖 Generated with Claude Code

JS metrics use stock sdk-metrics and export from JS on every platform; native
metrics use the native SDK and RNOtel.meter. Both read exportConfig.metrics,
and native hands JS its resource and merged metrics config through the
initialize result. Nothing crosses the seam per measurement.

Also replaces exportConfig.url with one URL per signal (traces, metrics) and
shared plus per-signal headers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adhorodyski adhorodyski mentioned this pull request Nov 26, 2026
@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