-
Notifications
You must be signed in to change notification settings - Fork 68
Monitoring: NodeSDK + Otel + Langfuse #168
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 ↗︎
|
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.
Pull Request Overview
This PR introduces an alternative monitoring implementation using the NodeSDK with OpenTelemetry and Langfuse while removing the dependency on the @vercel/otel package. Key changes include:
- Adding experimental telemetry configuration blocks to various generate* calls across multiple modules.
- Integrating telemetry metadata into the playbook, chat artifact, and monitoring functions.
- Introducing NodeSDK instrumentation in the instrumentation files and updated Docker compose configuration for Langfuse.
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/dbagent/src/lib/monitoring/runner.ts | Adds telemetry metadata for notifications, playbook, and summary prompts. |
| apps/dbagent/src/lib/ai/tools/artifacts.ts | Integrates telemetry metadata into the suggestion request tool. |
| apps/dbagent/src/components/playbooks/action.ts | Introduces telemetry metadata for playbook content generation. |
| apps/dbagent/src/components/monitoring/actions.ts | Adds telemetry metadata for generating cron expressions. |
| apps/dbagent/src/components/chat/artifacts/text/server.ts | Applies telemetry metadata for text artifact creation and updates. |
| apps/dbagent/src/components/chat/artifacts/sheet/server.ts | Applies telemetry metadata for sheet artifact creation and updates. |
| apps/dbagent/src/app/api/chat/route.ts | Includes telemetry metadata with detailed connection and model info in the chat API. |
| apps/dbagent/src/app/(main)/projects/[project]/chats/actions.ts | Adds telemetry metadata for generating chat titles. |
| apps/dbagent/instrumentation.ts & instrumentation-node.ts | Introduces NodeSDK instrumentation using OpenTelemetry and Langfuse. |
| apps/dbagent/dev/langfuse/docker-compose.yml | Updates configuration for Langfuse and related services. |
Files not reviewed (2)
- apps/dbagent/package.json: Language not supported
- apps/dbagent/tsconfig.json: Language not supported
| experimental_telemetry: { | ||
| isEnabled: true, | ||
| metadata: { | ||
| tags: ['monitoring', 'notification'] | ||
| } | ||
| } |
Copilot
AI
May 6, 2025
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.
[nitpick] The experimental_telemetry block is repetitively added in multiple functions. Consider extracting the common telemetry metadata structure into a helper function or constant to improve maintainability and reduce duplication.
| experimental_telemetry: { | |
| isEnabled: true, | |
| metadata: { | |
| tags: ['monitoring', 'notification'] | |
| } | |
| } | |
| experimental_telemetry: EXPERIMENTAL_TELEMETRY |
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.
Well, this is to be expected.
|
Vercel OTEL has some extra tracers that we might want to add but we can do it in the future. |
Alternative implementation to #156
This change uses the NodeSDK and does not rely on @vercel/otel package. On the plus side, I haven't had to fight version incompatibilities between a few packages.