opentelemetry-js-contrib icon indicating copy to clipboard operation
opentelemetry-js-contrib copied to clipboard

[opentelemetry-instrumentation-openai] Add openai sdk

Open AmanAgarwal041 opened this issue 1 year ago • 4 comments

Is your instrumentation request related to a problem? Please describe

Add an instrument for openai to handle telemetry for chat completions

Is it applicable for Node or Browser or both?

Its applicable for Node

Do you expect this instrumentation to be commonly used?

Yes

Weekly Downloads:

What version of instrumentation are you interested in using?

Versions:

Code Owners

@AmanAgarwal041 @patcher9

Additional context

AmanAgarwal041 avatar Aug 07 '24 19:08 AmanAgarwal041

@pichlermarc Does this instrumentation request good to get started ?

AmanAgarwal041 avatar Aug 07 '24 19:08 AmanAgarwal041

@AmanAgarwal041 thanks for opening the request

A few more questions:

  • did you reach out to the owners of the OpenAI org about hosting the package there?
  • is there a reason why you'd like to have this added here as opposed to hosting it in a seperate repo where you can have full control over issue triage, release cadence and more?

The reason I'm asking is that we're overwhelmed here with different instrumentation packages as we have to be familiar with the source code of the package we're instrumenting - we've had numerous component owners jump ship after contributing a component and it's simply not feasible for maintainers of this repo to be experts in the inner workings of 40+ wildly different packages.

As this is the case you'd still be mostly maintaining this yourself here, as you would in a separate repo - but with less permissions and less control over what you can do and cannot do.

pichlermarc avatar Aug 19 '24 07:08 pichlermarc

@pichlermarc to answer your questions

  • I haven't had a chance to reach out to openai org contributors about hosting it there. I feel like since the opentelemetry contrib packages for python are increasing and there is a still open issue for openai instrumentation, so it make sense to add a support for the js as well.
  • Creating it in a separate repo would actually be like following outdated semantic conventions. But keeping it here would actually restrict the maintainers to follow the otel conventions and keep it up to date.

I understand the maintaining it in a separate repo is lesser pain but keeping it here would actually make it trust worthy and genuine to get adopted.

AmanAgarwal041 avatar Aug 23 '24 19:08 AmanAgarwal041

@pichlermarc I have created a draft PR for now.

AmanAgarwal041 avatar Aug 23 '24 19:08 AmanAgarwal041

An instrumentation-openai was added in https://github.com/open-telemetry/opentelemetry-js-contrib/pull/2941

trentm avatar Oct 07 '25 15:10 trentm