Repository navigation
docs(openrouter-analytics): sync request-outcome metrics, time-range bounds, throughput percentiles, and read-only key access with openrouter-web - #196
Conversation
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
Original prompt from Automation
|
…its and .999 end bound
…and partial-day range reads
…pace filters, and request-outcome exclusions
…access Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
openrouter-web#49758 (plus the hourly rollup in #49838) adds three public analytics metrics read from
endpoint_requests. They count each request once, using its final outcome, and include failed requests:total_request_count: every request, failed ones includedgateway_5xx_count: final outcome is a 5xx and no provider was reached (terminal_row_kind = no_attempt)provider_5xx_count: final outcome is a 5xx after a provider callChanges to
openrouter-analytics-schema/SKILL.md:validateEndpointRequestsSource: these metrics combine only with each other and themodel/provider/api_key_id/user/workspacedimensions and filters. Anything else returns 400.Changes to
openrouter-analytics-query/SKILL.md(weekly analytics skills sync):time_range.endis a whole-second exclusive bound; an end at.999(e.g.23:59:59.999Z) now moves to the next second instead of being truncated (toExclusiveSecondEndMs, openrouter-web#49725).These metrics are scoped to the public analytics API and kept out of the Activity Explorer, so they show up in the
/metaresponse that these skills teach.Weekly sync 2026-10-12 to 2026-10-19
throughputPercentileMetricinmetric-registry.ts):pN_throughputusesquantileIf((100 - N) / 100), so it is the tokens/sec N% of requests reached or exceeded andp90_throughput≤p50_throughput. Documented inopenrouter-analytics-schema(performance metrics) andopenrouter-analytics(interpreting results).isShortPartialDayRangeintable-resolver.ts): an MV-eligible query whose range is ≤ANALYTICS_MAX_PARTIAL_DAY_RANGE_MS(2 days), starts or ends off UTC midnight (23:59:59.999counts as midnight), and starts within the last 30 days now readsuser_activity_minuteinstead of the daily MV, so totals cover only the requested window. Documented inopenrouter-analytics-queryTime Range Behavior.Weekly sync 2026-10-19 to 2026-10-26
GET /analytics/metaandPOST /analytics/querynow passorganizationViewOptIn(Permission.AnalyticsView)togetUser, so a read-only management key on an organization is accepted (resolveManagementKeystill rejects read-only keys outside an organization with 403). Documented in the Prerequisites of all three analytics skills, theopenrouter-analyticsAPI Reference, and theopenrouter-analytics-query403 row.workspacefilter values return 400 (openrouter-web#53772,buildOverrideFilterinfilter-builder.tschecks UUID-typed override filters againstGUID_PATTERN). Documented in theopenrouter-analytics-queryfilter notes and theopenrouter-analytics-schemaFilter Value Reference.buildEndpointRequestsSubqueryfiltersno_endpoints_reason NOT IN NON_MODEL_NO_ATTEMPT_REASONS_SQL, which coversresponse_cache_hitandrejected_before_provider). Documented under Request-outcome metrics inopenrouter-analytics-schema.Weekly sync 2026-11-02 to 2026-11-09
GET /analytics/meta,POST /analytics/query) now rate-limit at 256 requests per minute per IP (was 64). Updated the 429 message inopenrouter-analytics/scripts/lib.ts. The matching SKILL.md lines are updated in docs(openrouter-analytics-query): sync with openrouter-web changes #207 and docs(openrouter-analytics-schema): sync with openrouter-web changes #208, so this PR leaves them alone to avoid conflicts.Weekly sync 2026-11-09 to 2026-11-16
GET /analytics/metaandPOST /analytics/querynow passANALYTICS_MANAGEMENT_KEY_OPT_IN, which accepts a workspace-scoped key holdingactivity:view_allon its own workspace. Such a key reads only that workspace: aworkspacefilter naming another workspace returns 403 (hasForeignWorkspaceFilter), legacy rows with no workspace are excluded, and possible-cache metrics return 400 (buildAnalyticsWorkspaceScopeClause). Documented in the Prerequisites ofopenrouter-analyticsandopenrouter-analytics-schemaand in theopenrouter-analyticsAPI Reference. Theopenrouter-analytics-queryside is already in docs(openrouter-analytics-query): sync with openrouter-web changes #207.