-
Notifications
You must be signed in to change notification settings - Fork 7
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 OpenTelemetry tracing via Sentry #38
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This adds OpenTelemetry tracing via Sentry to the base model class, which applies it to all models. It currently makes Sentry a peer dependency, which means we either need to do a major version bump and force all users into Sentry, or find a way to conditionally import Sentry and handle the case where it's not installed.
...mergedContext, | ||
}); | ||
|
||
return Sentry.startSpan({ name: spanName, op: 'llm' }, async (span) => { |
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.
I bet we could pas this in as an optional function in the constructor (telemetryWrapper
or something) so that we don't need the sentry dependency in the library. (Or pass it as an argument to run
).
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.
yeah, i think that is the correct approach. however, we could use this asap, so i'm going to release it as a major version bump with a warning and we will make it optional in a future major release.
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.
@brianbegy @cfortuner i released it as v3 but as a prerelase with the next
tag so we can use it, but it won't be used for anyone that does npm install @dexaai/dexter
.
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.
Looks good! I'm ok with major version bump to keep things simple for us.
This adds OpenTelemetry tracing via Sentry to the base model class,
which applies it to all models.
It currently makes Sentry a peer dependency, which means we either need
to do a major version bump and force all users into Sentry, or find a
way to conditionally import Sentry and handle the case where it's not
installed.
Example trace from Sentry: