-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
OpenTelemetry instrumentation for go-openai #634
Comments
Hey @nirga, that sounds like a really nice-to-have feature! Before we go to the implementation stage, what's your vision on how end-user API could look like? |
@sashabaranov that's a good question! I was thinking to have the user enable tracing by calling some function on the openai client object like - client := openai.NewClient("token")
tracer := traceloop.NewTracer()
client.enableTracing(tracer) Or it can even be when creating the client |
@nirga sounds good! Let's just make sure that the tracer is passed as an interface so it would be possible to instrument with other libraries, too. |
I'll get to work on this this week @sashabaranov |
@nirga Sorry, I'm not sure I 100% understand the question. I think that the client<->tracer interface should not lose any information and be ergonomic at the same time. In terms of "not losing information", — we can pass complete requests (JSON-encoded strings?) and a tracer can take all the information it needs. We can even use HTTP tracing https://go.dev/blog/http-tracing — it's possible to specify custom HTTP client/transport with this library (see proxying example in the README). But I'm not sure whether this would be useful and ergonomic for tracers to use — would love your input here! |
Is your feature request related to a problem? Please describe.
I'm the maintainer of OpenLLMetry where we built a set of extensions of OpenTelemetry for GenAI applications. We currently support Python and Typescript (where we can easily monkey-patch the libraries within our instrumentations) and want to extend this to Go. Because there isn't a way to easily monkey-patch code in Go, we currently force our users to do it manually and I'd love to add this natively to your SDK so it will happen automagically.
Describe the solution you'd like
An ability for a user to turn on go opentelemetry instrumentation which uses our semantic convention. Then, the user can connect it to any observability tools they want - Datadog, Honeycomb, Traceloop, etc.
Additional context
Willing to do the PR and the work, just wanted a buy-in from the team before starting to work.
The text was updated successfully, but these errors were encountered: