Repository navigation
M16.2 Every API stack: SDK middleware and OpenTelemetry #65
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
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 byContent-Typeand gzip, Bearer key withanalytics:write; read withprotowire, no OTLP module.SERVERspans only:http.request.method,http.route,http.response.status_code, duration,url.pathfor inference only,client.addressfor the country, body sizes when present; resourceservice.name,deployment.environment.name(ordeployment.environment),service.versionas release,service.instance.id;yuva.consumerandyuva.api_versionspan attributes; weight from tracestateot=th.200withpartial_successfor invalid spans,429/503withRetry-After. -
POST /client/v1/analytics/{key}/requestsfor app-side records (up to 100,a.platformin the property's platforms, sourceapp, no consumer, the property'scollectionrules).
yuva-widget (web SDK)
-
createMonitoronuseyuva/server(Web SDK: server helpers for identity tokens, webhooks and analytics (useyuva/server) #60) with middleware for srvx, h3 (Web SDK: h3 handlers for identity tokens, webhooks and analytics (useyuva/h3) #61), Nitro and Nuxt (Nitro module and Nuxt server integration: identity route, webhooks, analytics (useyuva/nitro) #62), Hono, Express, Fastify and Next.js route handlers; each takes the route pattern from its router and flushes throughwaitUntilor the server's close hook; optionalsampleRatefor successful requests only.
yuva-mobile
- Swift
YuvaAnalyticsand Kotlinyuva-analytics: optional timing of the host app's calls to its own API (URLSessionand 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity
feat(sdk/js): createMonitor and API monitoring middleware for srvx, h…
feat(api): API monitoring takes OpenTelemetry traces and app-side req…
chore(sdk): regenerate the Go client and schema.gen.ts for OTLP trace…
chore(web): regenerate schema.gen.ts for OTLP traces and app-side req…
fix(sdk/js): API monitoring flushes at once on serverless platforms a…
fix(api): OTLP spans of the HTTP semantic conventions 1.20 and before…
chore(sdk): regenerate the Go client and schema.gen.ts for the older …
chore(web): regenerate schema.gen.ts for the older OTLP attribute names
docs: API monitoring guides for Go, JavaScript frameworks and OpenTel…
feat(sdk/swift): YuvaAnalytics times the app's calls to its own API
feat(sdk/kotlin): yuva-analytics times the app's calls to its own API
docs: API monitoring from iOS and Android apps
productdevbook commentedon Oct 14, 2026
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.
productdevbook commentedon Oct 14, 2026
This step's code is no longer on main; it lives in #72.