You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/mcp has zero queryable request telemetry. Found while diagnosing the 2026-07-05 paying-customer ticket (#4859/#4860): we could not see the customer's -32001 "Invalid API key" rejections or their tools/call failures anywhere — the diagnosis had to be reconstructed indirectly from REST-side Axiom rows and Convex lastUsedAt timestamps.
Specifics:
wm_api_usage (Axiom) is emitted only by server/gateway.ts (emitUsageEvents). /mcp rewrites straight to api/mcp/handler.ts and never passes the gateway → no rows, ever. Auth rejections, quota 429s, and successes on the MCP surface are all invisible.
The mcp.toolcall / mcp.tools_list_emitted structured console.log lines (api/mcp/telemetry.ts) assume "Vercel log drain → analytics consumer" — but no log drain is configured (GET /v2/integrations/log-drains returns []). The lines evaporate after Vercel's dashboard retention window.
Emit a RequestEvent into wm_api_usage from the MCP handler (route /mcp, auth_kind ∈ anon/env_key/pro/user_key, status, reason ∈ e.g. invalid_key/subscription_inactive/quota_429/ok, principal per principalIdForLog) via ctx.waitUntil, reusing server/_shared/usage.ts builders — same envelope, one new emitter callsite.
Alternatively (or additionally) configure a Vercel log drain so the existing mcp.toolcall lines land somewhere queryable — but the usage-event route gives customer_id-joinable data consistent with the REST surface, which is what support tickets need.
Gap
/mcphas zero queryable request telemetry. Found while diagnosing the 2026-07-05 paying-customer ticket (#4859/#4860): we could not see the customer's-32001 "Invalid API key"rejections or theirtools/callfailures anywhere — the diagnosis had to be reconstructed indirectly from REST-side Axiom rows and ConvexlastUsedAttimestamps.Specifics:
wm_api_usage(Axiom) is emitted only byserver/gateway.ts(emitUsageEvents)./mcprewrites straight toapi/mcp/handler.tsand never passes the gateway → no rows, ever. Auth rejections, quota 429s, and successes on the MCP surface are all invisible.mcp.toolcall/mcp.tools_list_emittedstructuredconsole.loglines (api/mcp/telemetry.ts) assume "Vercel log drain → analytics consumer" — but no log drain is configured (GET /v2/integrations/log-drainsreturns[]). The lines evaporate after Vercel's dashboard retention window.Proposal
RequestEventintowm_api_usagefrom the MCP handler (route/mcp,auth_kind∈ anon/env_key/pro/user_key, status, reason ∈ e.g.invalid_key/subscription_inactive/quota_429/ok, principal perprincipalIdForLog) viactx.waitUntil, reusingserver/_shared/usage.tsbuilders — same envelope, one new emitter callsite.mcp.toolcalllines land somewhere queryable — but the usage-event route gives customer_id-joinable data consistent with the REST surface, which is what support tickets need.invalid_keyspikes per principal/IP (would have surfaced bug(mcp): /mcp rejects all customer-issued wm_ API keys — X-WorldMonitor-Key path only checks WORLDMONITOR_VALID_KEYS env allowlist #4859's customer on day one).