Skip to content

Conversation

@unnoq
Copy link
Member

@unnoq unnoq commented Aug 11, 2025

Summary by CodeRabbit

  • Documentation

    • Added Sentry integration guide with installation steps, OpenTelemetry setup (including ORPC instrumentation), and examples for automatic instrumentation and manual error capture via middleware.
    • Added Sentry entry to the Integrations section of the docs sidebar for easy navigation.
  • Chores

    • Added a development dependency to support Sentry-related documentation.

@vercel
Copy link

vercel bot commented Aug 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
orpc ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 11, 2025 10:10am

@coderabbitai
Copy link

coderabbitai bot commented Aug 11, 2025

Walkthrough

Adds Sentry integration documentation and navigation entry to the docs, and introduces @sentry/node as a devDependency for the content app.

Changes

Cohort / File(s) Summary of changes
Docs navigation config
apps/content/.vitepress/config.ts
Inserts Sentry item in the Integrations section of the docs sidebar: { text: 'Sentry', link: '/docs/integrations/sentry' }.
Sentry integration docs
apps/content/docs/integrations/sentry.md
Adds guide for integrating oRPC with Sentry using OpenTelemetry and middleware; includes install commands and example setup.
Content app dependencies
apps/content/package.json
Adds devDependency "@sentry/node": "^10.3.0".

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
Loading

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related PRs

  • unnoq/orpc#699: Adds integration docs and corresponding sidebar entries, similar scope and locations.
  • unnoq/orpc#555: Updates the same docs sidebar Integrations list in VitePress config.
  • unnoq/orpc#197: Adds a new entry to themeConfig.sidebar['/docs/'] in the same config file.

Suggested labels

size:XL

Poem

A hop, a skip, to Sentry we go,
Traces weave where the errors show.
oRPC drums a telemetry beat,
Middleware catches little feet.
With whiskers twitching, logs alight—
Bugs beware, we nibble the night! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/sentry-integration

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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

  1. 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.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 11, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@pkg-pr-new
Copy link

pkg-pr-new bot commented Aug 11, 2025

More templates

@orpc/arktype

npm i https://pkg.pr.new/@orpc/arktype@855

@orpc/client

npm i https://pkg.pr.new/@orpc/client@855

@orpc/contract

npm i https://pkg.pr.new/@orpc/contract@855

@orpc/experimental-durable-event-iterator

npm i https://pkg.pr.new/@orpc/experimental-durable-event-iterator@855

@orpc/hey-api

npm i https://pkg.pr.new/@orpc/hey-api@855

@orpc/json-schema

npm i https://pkg.pr.new/@orpc/json-schema@855

@orpc/json-schema-typed

npm i https://pkg.pr.new/@orpc/json-schema-typed@855

@orpc/nest

npm i https://pkg.pr.new/@orpc/nest@855

@orpc/openapi

npm i https://pkg.pr.new/@orpc/openapi@855

@orpc/openapi-client

npm i https://pkg.pr.new/@orpc/openapi-client@855

@orpc/otel

npm i https://pkg.pr.new/@orpc/otel@855

@orpc/react

npm i https://pkg.pr.new/@orpc/react@855

@orpc/react-query

npm i https://pkg.pr.new/@orpc/react-query@855

@orpc/server

npm i https://pkg.pr.new/@orpc/server@855

@orpc/shared

npm i https://pkg.pr.new/@orpc/shared@855

@orpc/solid-query

npm i https://pkg.pr.new/@orpc/solid-query@855

@orpc/standard-server

npm i https://pkg.pr.new/@orpc/standard-server@855

@orpc/standard-server-aws-lambda

npm i https://pkg.pr.new/@orpc/standard-server-aws-lambda@855

@orpc/standard-server-fetch

npm i https://pkg.pr.new/@orpc/standard-server-fetch@855

@orpc/standard-server-node

npm i https://pkg.pr.new/@orpc/standard-server-node@855

@orpc/standard-server-peer

npm i https://pkg.pr.new/@orpc/standard-server-peer@855

@orpc/svelte-query

npm i https://pkg.pr.new/@orpc/svelte-query@855

@orpc/tanstack-query

npm i https://pkg.pr.new/@orpc/tanstack-query@855

@orpc/trpc

npm i https://pkg.pr.new/@orpc/trpc@855

@orpc/valibot

npm i https://pkg.pr.new/@orpc/valibot@855

@orpc/vue-colada

npm i https://pkg.pr.new/@orpc/vue-colada@855

@orpc/vue-query

npm i https://pkg.pr.new/@orpc/vue-query@855

@orpc/zod

npm i https://pkg.pr.new/@orpc/zod@855

commit: 922a4dc

Copy link

@coderabbitai coderabbitai bot left a 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: true ships 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

📥 Commits

Reviewing files that changed from the base of the PR and between a320605 and 922a4dc.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is 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-date

We’ve verified that ^10.3.0 corresponds to the current “latest” dist-tag (10.3.0) for @sentry/node on npm. No changes required.

apps/content/docs/integrations/sentry.md (1)

52-62: openTelemetryInstrumentations is supported in @​sentry/node v8+—no change needed

The openTelemetryInstrumentations option 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 your NodeSDK with new 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.

@unnoq unnoq merged commit 61aed82 into main Aug 11, 2025
11 checks passed
@valerii15298
Copy link
Contributor

Thank you, so quick!
I just wanted to create discussion about how to integrate sentry with oRPC otel in the best way and then saw this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants