Description
Confirm this is a feature request for the Node library and not the underlying OpenAI API.
- This is a feature request for the Node library
Describe the feature or improvement you're requesting
There are quite a few instrumentation libraries out there that instrument OpenAI.
To name a few:
- https://github.com/elastic/elastic-otel-node/tree/main/packages/instrumentation-openai
- https://github.com/traceloop/openllmetry-js/tree/main/packages/instrumentation-openai
- https://github.com/Arize-ai/openinference/tree/main/js/packages/openinference-instrumentation-openai
They use monkey-patching which is error prone and also they provide different set of features and inconsistent (with each other) telemetry.
In OTel world we solve it with semantic conventions which cover GenAI - https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai
OpenAI providing a common instrumentation library/plugin or baking instrumentation code into the Node SDK would solve observability problem for the end users and simplify support and lib maintenance.
Additional context
Here's an example of how instrumentation via a plugin can be done - https://www.npmjs.com/package/@azure/opentelemetry-instrumentation-azure-sdk