Skip to content

docs(openrouter-analytics): sync request-outcome metrics, time-range bounds, throughput percentiles, and read-only key access with openrouter-web - #196

Open
devin-ai-integration[bot] wants to merge 7 commits into
mainfrom
devin/1791478945-update-openrouter-analytics-schema
Open

devin-ai-integration[bot] wants to merge 7 commits into
mainfrom
devin/1791478945-update-openrouter-analytics-schema

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

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 included
  • gateway_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 call

Changes to openrouter-analytics-schema/SKILL.md:

  • Adds a "Request-outcome metrics" category. It notes the 31-day limit (the source is not the daily MV) and the compatibility rule enforced by validateEndpointRequestsSource: these metrics combine only with each other and the model/provider/api_key_id/user/workspace dimensions and filters. Anything else returns 400.
  • Adds a question-mapping row and a Constraints bullet for the same rule.
  • Notes that server-side query timeouts now return 408. The same PR changed this; they used to surface as parse errors.

Changes to openrouter-analytics-query/SKILL.md (weekly analytics skills sync):

  • Same request-outcome compatibility rule and 31-day limit in the 400 error row and Time Range Behavior.
  • time_range.end is 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 /meta response that these skills teach.

Weekly sync 2026-10-12 to 2026-10-19

  • Throughput percentiles now read the slow tail (openrouter-web#50909, throughputPercentileMetric in metric-registry.ts): pN_throughput uses quantileIf((100 - N) / 100), so it is the tokens/sec N% of requests reached or exceeded and p90_throughput ≤ p50_throughput. Documented in openrouter-analytics-schema (performance metrics) and openrouter-analytics (interpreting results).
  • Short partial-day ranges read the minute MV (openrouter-web#50516, isShortPartialDayRange in table-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.999 counts as midnight), and starts within the last 30 days now reads user_activity_minute instead of the daily MV, so totals cover only the requested window. Documented in openrouter-analytics-query Time Range Behavior.

Weekly sync 2026-10-19 to 2026-10-26

  • Read-only management keys can read analytics (openrouter-web#53735): GET /analytics/meta and POST /analytics/query now pass organizationViewOptIn(Permission.AnalyticsView) to getUser, so a read-only management key on an organization is accepted (resolveManagementKey still rejects read-only keys outside an organization with 403). Documented in the Prerequisites of all three analytics skills, the openrouter-analytics API Reference, and the openrouter-analytics-query 403 row.
  • Non-UUID workspace filter values return 400 (openrouter-web#53772, buildOverrideFilter in filter-builder.ts checks UUID-typed override filters against GUID_PATTERN). Documented in the openrouter-analytics-query filter notes and the openrouter-analytics-schema Filter Value Reference.
  • Request-outcome metrics skip response-cache hits and pre-provider failures (openrouter-web#53585, buildEndpointRequestsSubquery filters no_endpoints_reason NOT IN NON_MODEL_NO_ATTEMPT_REASONS_SQL, which covers response_cache_hit and rejected_before_provider). Documented under Request-outcome metrics in openrouter-analytics-schema.

Weekly sync 2026-11-02 to 2026-11-09

Weekly sync 2026-11-09 to 2026-11-16

  • Workspace-scoped management keys can read analytics: GET /analytics/meta and POST /analytics/query now pass ANALYTICS_MANAGEMENT_KEY_OPT_IN, which accepts a workspace-scoped key holding activity:view_all on its own workspace. Such a key reads only that workspace: a workspace filter naming another workspace returns 403 (hasForeignWorkspaceFilter), legacy rows with no workspace are excluded, and possible-cache metrics return 400 (buildAnalyticsWorkspaceScopeClause). Documented in the Prerequisites of openrouter-analytics and openrouter-analytics-schema and in the openrouter-analytics API Reference. The openrouter-analytics-query side is already in docs(openrouter-analytics-query): sync with openrouter-web changes #207.

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Original prompt from Automation

You are the public skills sync pipeline. Your job is to scan PRs merged to main on OpenRouterTeam/openrouter-web in the last 24 hours, determine if any changes warrant updating the public agent skills in OpenRouterTeam/skills, and open PRs to the skills repo when updates are needed.

#``# Step 1: Identify relevant merged PRs

Clone both repos:

cd /home/ubuntu/repos/openrouter-web
git fetch origin main
git log --since='24 hours ago' --merges --first-parent origin/main --pretty=format:'%H|%s' --name-only

For each merged PR, collect the list of changed files. Only PRs that touch the paths in the mapping below are relevant. Skip bot commits (devin-ai-integration[bot], Devin AI, GitHub Actions Bot, openrouter[bot], opencode-agent[bot], OpenRouter SDK Bot, Claude, detail-app[bot], forge-the-devex-intern[bot], dependabot[bot]).

If no relevant PRs were merged, post a short message to the #devrel Slack channel (C08LQFVSC7Q) saying no skill-relevant changes were detected today, and exit.

#``# Step 2: Map changed files to affected skills

Use this mapping to determine which public skills are potentially affected:

openrouter-web paths Affected skill(s) in OpenRouterTeam/skills
sdks/typescript/, packages/llm-interfaces/ openrouter-typescript-sdk, openrouter-agent-migration
services/cfw-*/src/routes/*analytics*, analytics query/response schemas openrouter-analytics, openrouter-analytics-query, openrouter-analytics-schema
Generation routes, /api/v1/generation openrouter-generations
Image generation adapters, packages/image-generation/ openrouter-images
supabase/seeds/, model schemas, /api/v1/models route openrouter-models
OAuth/auth routes, PKCE flow code openrouter-oauth
STT adapters, services/cfw-stt-api/, /api/v1/audio/transcriptions openrouter-stt
TTS routes, /api/v1/audio/speech openrouter-tts
Video adapters, /api/v1/videos openrouter-video
``@`openr... (3383 chars truncated...)

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration devin-ai-integration Bot changed the title docs(openrouter-analytics-schema): sync with openrouter-web changes Oct 12, 2026
@devin-ai-integration devin-ai-integration Bot changed the title docs(openrouter-analytics): sync request-outcome metrics and time-range end bound with openrouter-web Oct 19, 2026
…pace filters, and request-outcome exclusions
@devin-ai-integration devin-ai-integration Bot changed the title docs(openrouter-analytics): sync request-outcome metrics, time-range bounds, and throughput percentiles with openrouter-web Oct 26, 2026
…access

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

0 participants