Skip to content

docs: add analytics changelog and KB pages - #2780

Merged
smakosh merged 9 commits into
mainfrom
docs/analytics-changelog-and-kb
Jun 21, 2026
Merged

smakosh merged 9 commits into
mainfrom
docs/analytics-changelog-and-kb

Conversation

@smakosh

@smakosh smakosh commented Jun 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Documents the org analytics, per-API-key statistics, and Enterprise member analytics shipped in #2769 — across the public changelog and the docs knowledge base.

Changelog

  • New entry 2026-06-21-org-analytics ("Usage Analytics by Model, Key and Member") for the public changelog, covering the project Analytics page, per-key statistics, and member analytics with plan gating.

Knowledge base (apps/docs)

  • New page — Analytics (learn/analytics): project Cost by Model and Cost by Model Over Time charts, the Mappings / Canonical toggle, and how the data is computed.
  • New page — Member Analytics (learn/member-analytics): the Enterprise per-member usage table and member detail view (summary cards, most-used model/provider, cost by model, top providers), with Enterprise + owner/admin gating.
  • API Keys page: added a Per-Key Statistics section documenting the per-key analytics page.
  • Wired both new pages into learn/meta.json and the knowledge-base index.

Screenshots

Eight dashboard screenshots (light + dark) captured from a locally seeded DataFlow AI enterprise org via Playwright, dropped under apps/docs/public/learn/ and referenced with ThemedImage:

  • analytics-{light,dark}
  • api-key-statistics-{light,dark}
  • member-analytics-{light,dark}
  • member-analytics-detail-{light,dark}

Testing

  • pnpm format clean
  • turbo run build --filter=docs --filter=ui passes (validates changelog frontmatter + MDX)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added project Analytics page displaying cost, requests, and tokens by model with date range selection and visual cost trends
    • Added per-API-key statistics page accessible from the API Keys list
    • Added Enterprise Member Analytics for organization usage breakdown by team member, including cost, tokens, requests, and error rates
  • Documentation

    • Added Analytics, API Keys, and Member Analytics learn pages to documentation

Document the org analytics, per-API-key statistics, and Enterprise
member analytics shipped in #2769.

- New changelog entry (2026-06-21-org-analytics) for the public changelog.
- New knowledge-base pages: Analytics (project cost-by-model) and Member
  Analytics (Enterprise per-member breakdowns).
- Per-key statistics section added to the API Keys KB page.
- Eight dashboard screenshots (light + dark) captured from a seeded
  enterprise org for the new pages.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • apps/ui/public/changelog/org-analytics.png is excluded by !**/*.png

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: c5d16c15-6638-42ab-82dc-0ca7f22a89fa

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Three new documentation pages are added: analytics.mdx (project-level cost/request/token charts with a Mappings/Canonical toggle), member-analytics.mdx (Enterprise member usage table and detail view), and updated api-keys.mdx (per-key statistics section). Navigation metadata and the learn index are updated accordingly, and a changelog entry is added.

Changes

Usage Analytics Documentation

Layer / File(s) Summary
Navigation and index registration
apps/docs/content/learn/meta.json, apps/docs/content/learn/index.mdx
Adds "analytics" and "member-analytics" to the meta.json pages list; adds Analytics to Project Pages and Member Analytics (Enterprise) to Organization Pages in the learn index.
Project Analytics page and per-key statistics
apps/docs/content/learn/analytics.mdx, apps/docs/content/learn/api-keys.mdx
Adds analytics.mdx covering Cost by Model (tabbed by Cost/Requests/Tokens), Cost by Model Over Time (stacked area chart with Mappings/Canonical toggle), and data computation notes. Updates api-keys.mdx to replace "Open usage details" with "View Statistics" and adds a Per-Key Statistics section describing the scoped single-key analytics page.
Member Analytics page
apps/docs/content/learn/member-analytics.mdx
Adds member-analytics.mdx documenting the Enterprise-only Members Table (spend, tokens, requests, error rate, API key count with attribution to key creator) and the Member Detail view (summary cards, most-used model/provider/app, cost by model, top providers and apps tables).
Usage analytics changelog entry
apps/ui/src/content/changelog/2026-06-21-org-analytics.md
Adds a changelog article for the 2026-06-21 release covering cost-by-model project analytics, per-API-key statistics, Enterprise member analytics, the GET /analytics/members and GET /analytics/members/{userId} endpoints, and access restrictions by plan and role.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'docs: add analytics changelog and KB pages' accurately summarizes the main change: adding documentation content for analytics features, including changelog and knowledge base pages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/analytics-changelog-and-kb

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@steebchen

Copy link
Copy Markdown
Member

Images automagically compressed by Calibre's image-actions ✨

Compression reduced images by 68.2%, saving 815.1 KB.

Filename Before After Improvement Visual comparison
apps/docs/public/learn/api-key-statistics-dark.png 176.0 KB 53.2 KB 69.8% View diff
apps/docs/public/learn/api-key-statistics-light.png 176.1 KB 55.5 KB 68.5% View diff
apps/docs/public/learn/analytics-dark.png 159.0 KB 48.7 KB 69.4% View diff
apps/docs/public/learn/analytics-light.png 158.7 KB 49.0 KB 69.1% View diff
apps/docs/public/learn/member-analytics-dark.png 133.1 KB 34.3 KB 74.2% View diff
apps/docs/public/learn/member-analytics-light.png 129.4 KB 37.0 KB 71.4% View diff
apps/docs/public/learn/member-analytics-detail-dark.png 130.7 KB 38.5 KB 70.6% View diff
apps/docs/public/learn/member-analytics-detail-light.png 131.8 KB 63.6 KB 51.8% View diff

@steebchen

Copy link
Copy Markdown
Member

Images automagically compressed by Calibre's image-actions ✨

Compression reduced images by 7.9%, saving 19.4 KB.

Filename Before After Improvement Visual comparison
apps/docs/public/learn/api-key-statistics-light.png 55.5 KB 50.6 KB 8.9% View diff
apps/docs/public/learn/analytics-dark.png 48.7 KB 44.0 KB 9.7% View diff
apps/docs/public/learn/api-key-statistics-dark.png 53.2 KB 49.6 KB 6.8% View diff
apps/docs/public/learn/analytics-light.png 49.0 KB 45.8 KB 6.6% View diff
apps/docs/public/learn/member-analytics-detail-dark.png 38.5 KB 35.5 KB 7.6% View diff

3 images did not require optimisation.

@steebchen

Copy link
Copy Markdown
Member

Images automagically compressed by Calibre's image-actions ✨

Compression reduced images by 5.7%, saving 4.5 KB.

Filename Before After Improvement Visual comparison
apps/docs/public/learn/analytics-dark.png 44.0 KB 41.3 KB 6.1% View diff
apps/docs/public/learn/member-analytics-detail-dark.png 35.5 KB 33.7 KB 5.2% View diff

6 images did not require optimisation.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
apps/ui/src/content/changelog/2026-06-21-org-analytics.md (1)

14-14: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Simplify the opening sentence to avoid repetition.

Three consecutive sentences begin with "Which", creating a repetitive rhythm. Consider rewording the second or third sentence to improve readability.

Example revision:

-The dashboard could already tell you how much you spent and how many requests you sent — but not where it actually went. Which model is eating the budget? Which API key drives the traffic? Which person on the team? **Analytics** answers all three, with cost, request, and token breakdowns by model, by key, and by member.
+The dashboard could already tell you how much you spent and how many requests you sent — but not where it actually went. Which model is eating the budget? Which API key drives the traffic? Who is the biggest spender on the team? **Analytics** answers all three, with cost, request, and token breakdowns by model, by key, and by member.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/ui/src/content/changelog/2026-06-21-org-analytics.md` at line 14, The
opening paragraph of the analytics feature description contains three
consecutive sentences that begin with "Which", creating repetitive rhythm that
affects readability. Restructure at least one of these questions (about model,
API key, or team member) to use different phrasing or sentence structure while
maintaining the same meaning and emphasis. For example, rephrase one question as
a statement or combine related questions to create better flow and variety in
the prose.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/ui/src/content/changelog/2026-06-21-org-analytics.md`:
- Around line 7-11: The image reference in the frontmatter of the changelog file
points to a missing asset `/changelog/org-analytics.png` that does not exist in
`apps/ui/public/changelog/`. To fix this, either locate the analytics image
asset from `apps/docs/public/learn/` (such as `api-key-statistics-dark.png` or
`member-analytics-light.png`) and copy it to the `apps/ui/public/changelog/`
directory renaming it to `org-analytics.png`, or update the src path in the
image frontmatter to reference one of the existing analytics images from the
docs directory. Ensure the image dimensions (width: 1536, height: 1024) and alt
text remain appropriate for the referenced asset.

---

Nitpick comments:
In `@apps/ui/src/content/changelog/2026-06-21-org-analytics.md`:
- Line 14: The opening paragraph of the analytics feature description contains
three consecutive sentences that begin with "Which", creating repetitive rhythm
that affects readability. Restructure at least one of these questions (about
model, API key, or team member) to use different phrasing or sentence structure
while maintaining the same meaning and emphasis. For example, rephrase one
question as a statement or combine related questions to create better flow and
variety in the prose.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fee3a87e-6b7b-42e9-bf5e-8a7ba816e5c1

📥 Commits

Reviewing files that changed from the base of the PR and between a3ecd19 and 32a8b21.

⛔ Files ignored due to path filters (8)
  • apps/docs/public/learn/analytics-dark.png is excluded by !**/*.png
  • apps/docs/public/learn/analytics-light.png is excluded by !**/*.png
  • apps/docs/public/learn/api-key-statistics-dark.png is excluded by !**/*.png
  • apps/docs/public/learn/api-key-statistics-light.png is excluded by !**/*.png
  • apps/docs/public/learn/member-analytics-dark.png is excluded by !**/*.png
  • apps/docs/public/learn/member-analytics-detail-dark.png is excluded by !**/*.png
  • apps/docs/public/learn/member-analytics-detail-light.png is excluded by !**/*.png
  • apps/docs/public/learn/member-analytics-light.png is excluded by !**/*.png
📒 Files selected for processing (6)
  • apps/docs/content/learn/analytics.mdx
  • apps/docs/content/learn/api-keys.mdx
  • apps/docs/content/learn/index.mdx
  • apps/docs/content/learn/member-analytics.mdx
  • apps/docs/content/learn/meta.json
  • apps/ui/src/content/changelog/2026-06-21-org-analytics.md

Comment thread apps/ui/src/content/changelog/2026-06-21-org-analytics.md
Generated with gpt-image-2 via LLM Gateway (1536x1024).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@smakosh
smakosh added this pull request to the merge queue Jun 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to invalid changes in the merge commit Jun 21, 2026
@smakosh
smakosh enabled auto-merge June 21, 2026 21:57
@steebchen

Copy link
Copy Markdown
Member

Images automagically compressed by Calibre's image-actions ✨

Compression reduced images by 77.9%, saving 1.3 MB.

Filename Before After Improvement Visual comparison
apps/ui/public/changelog/org-analytics.png 1.7 MB 378.1 KB 77.9% View diff

8 images did not require optimisation.

@steebchen

Copy link
Copy Markdown
Member

Images automagically compressed by Calibre's image-actions ✨

Compression reduced images by 7.9%, saving 29.7 KB.

Filename Before After Improvement Visual comparison
apps/ui/public/changelog/org-analytics.png 378.1 KB 348.4 KB 7.9% View diff

8 images did not require optimisation.

@steebchen

Copy link
Copy Markdown
Member

Images automagically compressed by Calibre's image-actions ✨

Compression reduced images by 9.8%, saving 34.1 KB.

Filename Before After Improvement Visual comparison
apps/ui/public/changelog/org-analytics.png 348.4 KB 314.4 KB 9.8% View diff

8 images did not require optimisation.

@smakosh
smakosh added this pull request to the merge queue Jun 21, 2026
Merged via the queue into main with commit 6a55a0a Jun 21, 2026
12 checks passed
@smakosh
smakosh deleted the docs/analytics-changelog-and-kb branch June 21, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants