Skip to content

Conversation

@urso
Copy link
Contributor

@urso urso commented May 5, 2025

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.

@vercel
Copy link

vercel bot commented May 5, 2025

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

Name Status Preview Updated (UTC)
agent ✅ Ready (Inspect) Visit Preview May 12, 2025 0:36am

@urso urso marked this pull request as ready for review May 6, 2025 15:50
@urso urso requested review from SferaDev and Copilot May 6, 2025 15:50
Copy link
Contributor

Copilot AI left a 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

Comment on lines +94 to +99
experimental_telemetry: {
isEnabled: true,
metadata: {
tags: ['monitoring', 'notification']
}
}
Copy link

Copilot AI May 6, 2025

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.

Suggested change
experimental_telemetry: {
isEnabled: true,
metadata: {
tags: ['monitoring', 'notification']
}
}
experimental_telemetry: EXPERIMENTAL_TELEMETRY

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

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.

@SferaDev
Copy link
Member

SferaDev commented May 8, 2025

Vercel OTEL has some extra tracers that we might want to add but we can do it in the future.

@urso urso added this pull request to the merge queue May 12, 2025
Merged via the queue into main with commit 0e65c9c May 12, 2025
5 checks passed
@urso urso deleted the monitoring-nodesdk branch May 12, 2025 13:50
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.

3 participants