Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAnalytics documentation overhauled to use pre-aggregated tables instead of raw tables in query examples, replace JSON examples with curl-based API commands, reorganize content into use-case themes, introduce quick-reference and troubleshooting guides, remove deprecated sections, and make the Analytics section visible in navigation. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/docs/docs.json (1)
174-183: Analytics section now visible but missing new pages in navigation.The Analytics section visibility has been correctly changed to
hidden: false. However, based on the PR summary, two new documentation pages (quick-reference.mdxandtroubleshooting.mdx) have been added but are not listed in thepagesarray. These should be included in the navigation structure for discoverability."pages": [ "analytics/overview", "analytics/getting-started", "analytics/query-examples", "analytics/schema-reference", - "analytics/query-restrictions" + "analytics/query-restrictions", + "analytics/quick-reference", + "analytics/troubleshooting" ]apps/docs/analytics/schema-reference.mdx (1)
295-302: Error code name mismatch with query-restrictions.mdx.The Query Limits table references
query_rows_limit_exceeded, butquery-restrictions.mdx(line 109) uses the new error code namequery_result_rows_exceeded. This inconsistency will confuse users. The error code name should be synchronized.| Resource | Limit | Error Code | | ---------------- | ---------- | ----------------------------- | | Execution time | 30 seconds | `query_execution_timeout` | | Memory usage | 1 GB | `query_memory_limit_exceeded` | -| Rows to read | 10 million | `query_rows_limit_exceeded` | +| Result rows | 10 million | `query_result_rows_exceeded` | | Queries per hour | 1000 | `query_quota_exceeded` |
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
apps/docs/analytics/getting-started.mdx(3 hunks)apps/docs/analytics/overview.mdx(3 hunks)apps/docs/analytics/query-examples.mdx(9 hunks)apps/docs/analytics/query-restrictions.mdx(3 hunks)apps/docs/analytics/quick-reference.mdx(1 hunks)apps/docs/analytics/schema-reference.mdx(3 hunks)apps/docs/analytics/troubleshooting.mdx(1 hunks)apps/docs/docs.json(3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-15T19:53:28.487Z
Learnt from: mcstepp
Repo: unkeyed/unkey PR: 3952
File: go/proto/ctrl/v1/routing.proto:0-0
Timestamp: 2025-09-15T19:53:28.487Z
Learning: In the Unkey codebase, authentication/authorization errors intentionally return NOT_FOUND error codes instead of distinct auth error codes (like FORBIDDEN or UNAUTHORIZED) for security reasons. This prevents attackers from distinguishing between "resource doesn't exist" and "you don't have permission to access this resource", avoiding information disclosure about workspace existence and access boundaries.
Applied to files:
apps/docs/analytics/query-restrictions.mdx
📚 Learning: 2025-08-29T13:35:44.917Z
Learnt from: Flo4604
Repo: unkeyed/unkey PR: 3884
File: go/apps/api/openapi/openapi-generated.yaml:1828-1845
Timestamp: 2025-08-29T13:35:44.917Z
Learning: In the Unkey system, soft-deleted resources (like ratelimit namespaces) cannot be restored through the API or dashboard, but they can be restored manually via direct database operations by the support team. The error documentation should reflect that users need to contact support for restoration, as the current GoneErrorResponse description does.
Applied to files:
apps/docs/analytics/query-restrictions.mdx
🔇 Additional comments (5)
apps/docs/analytics/troubleshooting.mdx (1)
1-144: New troubleshooting guide is comprehensive and well-structured.The new troubleshooting documentation provides practical guidance across multiple common issues with clear examples and references to related documentation. The content aligns well with the other analytics documentation updates.
apps/docs/analytics/getting-started.mdx (1)
42-124: Well-executed migration to aggregated tables and CodeGroup format.The examples have been effectively migrated to use pre-aggregated tables (
key_verifications_per_day_v1,key_verifications_per_hour_v1) withSUM(count)instead ofCOUNT(*), and the CodeGroup wrapper with curl examples significantly improves usability. The performance tip is valuable.apps/docs/analytics/quick-reference.mdx (1)
1-209: Excellent new quick-reference documentation with clear patterns and guidance.The quick-reference guide is well-organized with practical SQL patterns, a helpful table selection guide, and common filter examples. The content is consistent with the broader analytics documentation updates, using aggregated tables and
SUM(count)patterns throughout.apps/docs/analytics/query-examples.mdx (1)
1-855: Excellent restructuring to CodeGroup format with consistent aggregated table patterns.The query examples have been comprehensively updated to use CodeGroup components with both SQL and curl formats. All examples consistently use pre-aggregated tables (
key_verifications_per_day_v1, etc.) andSUM(count)patterns. The organization by use case (Usage, User, API, Billing, Advanced) is logical and mirrors the quick-reference guide.apps/docs/analytics/overview.mdx (1)
59-83: All anchor references are correct and will properly resolve to their corresponding headings in query-examples.mdx:
#billing-usage-based-pricing→ "## Billing & Usage-Based Pricing" (line 570)#usage-analytics→ "## Usage Analytics" (line 35)#usage-by-user→ "## Usage by User" (line 142)
perkinsjr
left a comment
There was a problem hiding this comment.
LGTM.
Add SDK example here post launch analytics/getting-started

What does this PR do?
Enhances the Analytics documentation with improved readability, organization, and examples. The changes include:
Type of change
How should this be tested?
Checklist
Required
pnpm buildpnpm fmtmake fmton/godirectoryconsole.logsgit pull origin mainAppreciated