Skip to content
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

Add instrumentation for ai #13679

Closed
2 tasks
mydea opened this issue Sep 12, 2024 · 4 comments · Fixed by #13892
Closed
2 tasks

Add instrumentation for ai #13679

mydea opened this issue Sep 12, 2024 · 4 comments · Fixed by #13892
Assignees
Labels
Package: node Issues related to the Sentry Node SDK

Comments

@mydea
Copy link
Member

mydea commented Sep 12, 2024

Description

We want to support Vercel AI (https://github.com/vercel/ai). There seems to be some OTEL instrumentation baked in - we need to test this, and ensure this follows the LLM conventions: https://develop.sentry.dev/sdk/telemetry/traces/modules/llm-monitoring/ (which probably means adjusting the emitted spans accordingly).

Tasks

@mydea mydea added the Package: node Issues related to the Sentry Node SDK label Sep 12, 2024
@AbhiPrasad AbhiPrasad self-assigned this Sep 12, 2024
@AbhiPrasad
Copy link
Member

@AbhiPrasad
Copy link
Member

Gave it a try with https://github.com/e2b-dev/ai-artifacts

Looks pretty decent Image

Currently it collects:

ai.model.id
ai.model.provider
ai.prompt
ai.schema
ai.settings.mode

it doesn't seem to include any information about tokens used or similar, which is problematic for our llm monitoring.

It uses ai.X which matches our conventions more closely, but OTEL conventions seem to use gen_ai.X: https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/

@AbhiPrasad
Copy link
Member

Decision: We'll be making this an integration that lives in @sentry/node.

Right now to enable OTEL based telemetry in the SDK, you'll have to add experimental_telemetry: { isEnabled: true } to each individual function call. We'll probably add some OTEL instrumentation that automatically injects this so it doesn't have to be user configured.

Copy link
Contributor

A PR closing this issue has just been released 🚀

This issue was referenced by PR #13892, which was included in the 8.43.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: node Issues related to the Sentry Node SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants