-
Notifications
You must be signed in to change notification settings - Fork 385
docs: add Apitally to integrations #601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughAdds an "Apitally" entry to the Integrations sidebar and adds a new documentation page describing how to integrate Apitally with ElysiaJS, covering setup, consumer tracing, and request/application logging configuration with code examples and references. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant App as Elysia App
participant Plugin as apitallyPlugin
participant Cloud as Apitally
Dev->>App: configure apitallyPlugin({ clientId, env, requestLogging? })
App->>Plugin: initialize
Plugin-->>Cloud: register app/env
rect rgba(200,230,255,0.3)
note right of App: Incoming HTTP request
App->>Plugin: onRequest(ctx)
opt Consumer tracing provided
Plugin->>Plugin: derive consumer {identifier, name?, group?}
end
opt Request logging enabled
Plugin-->>Cloud: send request/response metadata (headers/body optional)
end
Plugin-->>App: continue handler
App-->>Cloud: optionally send application logs via captureLogs
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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 (5)
docs/integrations/apitally.md (5)
9-15
: Tighten SEO meta descriptions (active voice, clearer value props).Recommend more action-oriented, descriptive copy for both description and og:description.
Apply this diff:
- - name: 'description' - content: We may use Apitally to capture API metrics and logs. + - name: 'description' + content: Capture API metrics, errors, performance, and logs with Apitally for Elysia. - - name: 'og:description' - content: We may use Apitally to capture API metrics and logs. + - name: 'og:description' + content: Capture API metrics, errors, performance, and logs with Apitally for Elysia.
44-47
: Avoid hard-coding secrets; prefer env var in example.Use env in the snippet to model best practices and avoid copy-pasting secrets into code.
Apply this diff:
- apitallyPlugin({ - clientId: "your-client-id", - env: "dev", // or "prod" etc. - }), + apitallyPlugin({ + clientId: Bun.env.APITALLY_CLIENT_ID ?? "your-client-id", + env: "dev", // or "prod" etc. + }),Note: If not running on Bun, swap
Bun.env
forprocess.env
.
56-56
: Grammar: add “to” and parallelize phrasing.Small grammar tweak for clarity.
-You can associate requests with consumer identifiers, allowing you get insights into API adoption and filter logs and metrics by consumer. +You can associate requests with consumer identifiers, allowing you to get insights into API adoption and to filter logs and metrics by consumer.
71-73
: Grammar: singular “application”, gerund, and “what is”.Minor fixes for readability.
-Capturing request and applications logs is disabled by default. You can enable it by passing the `requestLogging` option to the plugin and -configure in detail what's included in the logs. +Capturing request and application logs is disabled by default. You can enable it by passing the `requestLogging` option to the plugin and +configuring in detail what is included in the logs.
69-93
: Add a privacy/PII warning near logging example.Enabling header/body logging can capture secrets and personal data. Add an admonition to set safe defaults and use redaction where possible.
Apply this diff (placed after the code block):
.get("/", () => "hello");
+::: warning
+Logging request/response headers or bodies may include secrets or personal data. Enable only what you need, consider redaction facilities, and disable logging for sensitive routes.
+:::</blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used: CodeRabbit UI** **Review profile: CHILL** **Plan: Pro** **💡 Knowledge Base configuration:** - MCP integration is disabled by default for public repositories - Jira integration is disabled by default for public repositories - Linear integration is disabled by default for public repositories You can enable these sources in your CodeRabbit configuration. <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 9448f7d3f22a370e7ca1796648cc1da0157b9a51 and becd33ed1c65ea9e22b76758592e8de81058ab17. </details> <details> <summary>📒 Files selected for processing (2)</summary> * `docs/.vitepress/config.ts` (1 hunks) * `docs/integrations/apitally.md` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🪛 LanguageTool</summary> <details> <summary>docs/integrations/apitally.md</summary> [grammar] ~21-~21: There might be a mistake here. Context: ...s API request logs and application logs, which are automatically correlated. ![A... (QB_NEW_EN) --- [grammar] ~71-~71: There might be a mistake here. Context: ...requestLogging` option to the plugin and configure in detail what's included in t... (QB_NEW_EN) </details> </details> </details> <details> <summary>🔇 Additional comments (2)</summary><blockquote> <details> <summary>docs/integrations/apitally.md (1)</summary> `24-24`: **Asset Path Verified – No Changes Needed** The image at `/recipe/apitally/traffic-dashboard.webp` correctly resolves to `docs/public/recipe/apitally/traffic-dashboard.webp`, which exists in the repo. No updates to the markdown or asset location are required. </details> <details> <summary>docs/.vitepress/config.ts (1)</summary> `440-443`: **Sidebar entry looks good; path matches page slug and keeps alphabetical order.** Adds Apitally under Integrations with correct link and placement. </details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
docs/integrations/apitally.md (2)
75-93
: Align logging example with SDK shape; remove undocumented key and use direct invocation
- Switch to the direct
useApitally
call (consistency with the basic example).- Verify whether
captureLogs
is a supported key; if not, remove it to prevent confusion.- Optionally surface additional documented keys (e.g., logQueryParams, logResponseHeaders, logException, mask* options).
import { Elysia } from "elysia"; -import { apitallyPlugin } from "apitally/elysia"; +import { useApitally } from "apitally/elysia"; -const app = new Elysia() - .use( - apitallyPlugin({ - clientId: "your-client-id", - env: "dev", // or "prod" etc. - requestLogging: { // [!code ++] - enabled: true, // [!code ++] - logRequestHeaders: true, // [!code ++] - logRequestBody: true, // [!code ++] - logResponseBody: true, // [!code ++] - captureLogs: true, // application logs // [!code ++] - }, // [!code ++] - }), - ) - .get("/", () => "hello"); +const app = new Elysia(); +useApitally(app, { + clientId: "your-client-id", + env: "dev", // or "prod" etc. + requestLogging: { + enabled: true, + logRequestHeaders: true, + logRequestBody: true, + logResponseBody: true, + // consider also: logQueryParams, logResponseHeaders, logException + // and safety knobs: maskQueryParams, maskHeaders, maskBodyFields, excludePaths + }, +}); +app.get("/", () => "hello");If you want, I can add a short example showing masking of common secrets (e.g., Authorization headers, tokens in bodies).
39-50
: Update import and invocation to match Apitally’s Elysia integration APIUse the official import and direct invocation style to avoid drift and make the example copy-pasteable.
import { Elysia } from "elysia"; -import { apitallyPlugin } from "apitally/elysia"; +import { useApitally } from "apitally/elysia"; -const app = new Elysia() - .use( - apitallyPlugin({ - clientId: "your-client-id", - env: "dev", // or "prod" etc. - }), - ) - .get("/", () => "hello"); +const app = new Elysia(); +useApitally(app, { + clientId: "your-client-id", + env: "dev", // or "prod" etc. + // optional: requestLogging, appVersion, logger, ... +}); +app.get("/", () => "hello");To confirm the exact import and option names for the current SDK version, please validate against Apitally’s docs.
🧹 Nitpick comments (4)
docs/integrations/apitally.md (4)
10-15
: Tighten meta descriptions to active voiceUse concise, action-oriented phrasing consistent with the rest of the docs.
- content: We may use Apitally to capture API metrics and logs. + content: Use Apitally to capture API metrics and logs. @@ - content: We may use Apitally to capture API metrics and logs. + content: Use Apitally to capture API metrics and logs.
21-23
: Streamline the sentence and avoid repetitionMinor style/grammar polish; also addresses the static analysis hint.
-It provides real-time insights into API usage, errors, and performance. It also captures API request logs and application logs, -which are automatically correlated. +It provides real-time insights into API usage, errors, and performance. It also captures request and application logs and automatically correlates them.
32-34
: Consider including npm/pnpm/yarn equivalentsMany readers don’t use Bun. Suggest adding alternative install commands (npm, pnpm, yarn) below the Bun snippet.
71-73
: Fix parallelism in the sentence and add a short safety note about PIIMinor grammar and a one-liner to nudge users toward masking sensitive data. Also addresses static analysis hint.
-Capturing request and application logs is disabled by default. You can enable it by passing the `requestLogging` option to the plugin and -configure in detail what's included in the logs. +Capturing request and application logs is disabled by default. You can enable it by passing the `requestLogging` option to the plugin and +configuring in detail what is included in the logs. Be mindful of sensitive data; use mask* options and excludePaths to avoid persisting secrets and PII.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
docs/integrations/apitally.md
(1 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/integrations/apitally.md
[grammar] ~21-~21: There might be a mistake here.
Context: ...s API request logs and application logs, which are automatically correlated. ![A...
(QB_NEW_EN)
[grammar] ~71-~71: There might be a mistake here.
Context: ...requestLogging` option to the plugin and configure in detail what's included in t...
(QB_NEW_EN)
🔇 Additional comments (3)
docs/integrations/apitally.md (3)
24-24
: Verify asset path is validCheck that /recipe/apitally/traffic-dashboard.webp exists in the repo and is included in this PR (or available in the static assets directory). Broken images hurt discoverability.
52-52
: Confirm the Elysia setup guide URLEnsure https://docs.apitally.io/frameworks/elysia is live; if not, link to the closest framework-agnostic JS SDK or Elysia-specific page.
59-66
: Validate context decoration and consumer fieldsConfirm that the plugin decorates the Elysia context as apitally and that accepted consumer fields are exactly identifier, name, and group. If the key or shape differs, update the example accordingly.
Apitally is a simple API monitoring and analytics tool with an official plugin for Elysia.
This adds a page under Integrations with setup instructions, following a similar structure to the existing pages in that section.
Summary by CodeRabbit