Skip to content

M16.2 Every API stack: SDK middleware and OpenTelemetry #65

Closed

Description

@productdevbook

Part of #63. Needs M16.1 and the web SDK server helpers #60, #61, #62.

Every API, whatever it is written in, reports to API monitoring without per-route code.

yuva-api

  • Contract and handler: POST /otlp/{propertyId}/v1/traces, OTLP/HTTP with binary protobuf and JSON by Content-Type and gzip, Bearer key with analytics:write; read with protowire, no OTLP module. SERVER spans only: http.request.method, http.route, http.response.status_code, duration, url.path for inference only, client.address for the country, body sizes when present; resource service.name, deployment.environment.name (or deployment.environment), service.version as release, service.instance.id; yuva.consumer and yuva.api_version span attributes; weight from tracestate ot=th. 200 with partial_success for invalid spans, 429/503 with Retry-After.
  • POST /client/v1/analytics/{key}/requests for app-side records (up to 100, a.platform in the property's platforms, source app, no consumer, the property's collection rules).

yuva-widget (web SDK)

yuva-mobile

  • Swift YuvaAnalytics and Kotlin yuva-analytics: optional timing of the host app's calls to its own API (URLSession and OkHttp interceptors), route from a host-supplied mapping, status, duration, app version; off until the host enables it, sent only when the app's analytics would be (consent mode and opt-out), queued offline like events.
  • Privacy manifest adds NSPrivacyCollectedDataTypePerformanceData (not linked, no tracking, analytics and app functionality; check the key against Xcode's list); the Play data safety guide adds "App info and performance › Diagnostics".

yuva-docs

  • One page per stack (Go, Node/Bun/Deno frameworks, OpenTelemetry for anything else with the two environment variables and "export every server span", iOS and Android client side); en, tr, de.

Done when

The same small API written for Go, h3, Nitro, Hono, Express and an OpenTelemetry-instrumented service (protobuf and JSON exporters) shows identical routes and counts; app-side records appear next to server-side ones for the same route, and a consent-mode property gets none before consent.

Activity

  1. productdevbook commented on Oct 14, 2026

    @productdevbook
    OwnerAuthor

    Done: OTLP/HTTP ingest with protobuf, JSON and pre-1.20 attribute names (124f6a1, 786eced), app-side records (124f6a1), web SDK middleware for srvx, h3, Nitro/Nuxt, Hono, Express, Fastify and Next.js (af834d4, 6b83b41), Swift and Kotlin request timing (181890b, fbbbba9), guides per stack in en, tr, de (5cac4dd, ddc91e5). The panel setting for an API property's app platforms follows with the M16.3 panel work.

  2. productdevbook commented on Oct 14, 2026

    @productdevbook
    OwnerAuthor

    This step's code is no longer on main; it lives in #72.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions