-
-
Notifications
You must be signed in to change notification settings - Fork 128
docs: Sentry Integration #855
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughAdds Sentry integration documentation and navigation entry to the docs, and introduces @sentry/node as a devDependency for the content app. Changes
Sequence Diagram(s)sequenceDiagram
participant DevApp as App
participant oRPC as oRPC Server
participant OTEL as OpenTelemetry
participant Sentry as Sentry
DevApp->>oRPC: Invoke procedure
oRPC->>OTEL: Create spans (ORPCInstrumentation)
OTEL-->>Sentry: Export traces/metrics
oRPC-->>DevApp: Return result or error
oRPC->>Sentry: captureException (middleware) on errors
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Possibly related PRs
Suggested labels
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 comments)
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.
Summary of Changes
Hello @unnoq, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request introduces comprehensive documentation for integrating Sentry, an error tracking and performance monitoring tool, with oRPC applications. It provides a new guide covering installation, setup using ORPCInstrumentation for distributed tracing, and methods for manually capturing errors.
Highlights
- Sentry Integration Guide: I've added a new documentation page (apps/content/docs/integrations/sentry.md) that outlines the steps to integrate Sentry with oRPC, focusing on error tracking and performance monitoring.
- Navigation Menu Addition: I've updated the documentation's navigation menu (apps/content/.vitepress/config.ts) to include a direct link to the new Sentry integration guide, making it easily discoverable.
- Dependency Management: I've incorporated the necessary @sentry/node package into apps/content/package.json and updated pnpm-lock.yaml to reflect this new dependency and other related package version changes, ensuring a consistent build environment.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request adds documentation for Sentry integration. The documentation is clear and well-structured. I've found one minor issue in the installation instructions where a required package was missing, and I've provided a suggestion to fix it. Otherwise, the changes look good.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
More templates
@orpc/arktype
@orpc/client
@orpc/contract
@orpc/experimental-durable-event-iterator
@orpc/hey-api
@orpc/json-schema
@orpc/json-schema-typed
@orpc/nest
@orpc/openapi
@orpc/openapi-client
@orpc/otel
@orpc/react
@orpc/react-query
@orpc/server
@orpc/shared
@orpc/solid-query
@orpc/standard-server
@orpc/standard-server-aws-lambda
@orpc/standard-server-fetch
@orpc/standard-server-node
@orpc/standard-server-peer
@orpc/svelte-query
@orpc/tanstack-query
@orpc/trpc
@orpc/valibot
@orpc/vue-colada
@orpc/vue-query
@orpc/zod
commit: |
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 (2)
apps/content/docs/integrations/sentry.md (2)
54-55: PII caution in example config.
sendDefaultPii: trueships personally identifiable information. Consider removing it from the default example or add a cautionary note to enable only where appropriate.- sendDefaultPii: true, + // Optional: Enable only if you have reviewed data policies and consent requirements + // sendDefaultPii: true,
66-83: Optional: enrich captured error context.To improve triage, consider adding request/procedure metadata to the Sentry scope before capturing the exception (e.g., route/procedure name, user id if available).
export const sentryMiddleware = os.middleware(async ({ next }) => { try { return await next() } catch (error) { - Sentry.captureException(error) // [!code highlight] + Sentry.withScope(scope => { + // Example: attach procedure/route metadata if available + // scope.setTag('orpc.procedure', ctx?.procedure ?? 'unknown') + Sentry.captureException(error) + }) // [!code highlight] throw error } })
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (3)
apps/content/.vitepress/config.ts(1 hunks)apps/content/docs/integrations/sentry.md(1 hunks)apps/content/package.json(1 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/content/docs/integrations/sentry.md
[grammar] ~46-~46: Ensure spelling is correct
Context: ...is class automatically instruments your oRPC client and server for distributed traci...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: test
- GitHub Check: publish-commit
- GitHub Check: lint
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
apps/content/package.json (1)
31-31: Confirm @sentry/node version is up-to-dateWe’ve verified that
^10.3.0corresponds to the current “latest” dist-tag (10.3.0) for@sentry/nodeon npm. No changes required.apps/content/docs/integrations/sentry.md (1)
52-62: openTelemetryInstrumentations is supported in @sentry/node v8+—no change neededThe
openTelemetryInstrumentationsoption you’ve used is valid for selecting additional OTEL auto-instrumentations in Sentry’s v8 Node SDK. You only need to modify this snippet if you want a fully custom OpenTelemetry setup:• To continue using Sentry’s built-in OTel instrumentation (with your extra ORPCInstrumentation), keep your existing code as is.
• If you prefer to manage OpenTelemetry entirely yourself, add:instrumenter: 'otel', skipOpenTelemetrySetup: true,in
Sentry.init({...})and then configure yourNodeSDKwithnew ORPCInstrumentation()outside of Sentry.apps/content/.vitepress/config.ts (1)
180-181: LGTM: Sentry doc added to Integrations.Nav entry aligns with the new page at
/docs/integrations/sentry.
|
Thank you, so quick! |
Summary by CodeRabbit
Documentation
Chores