Skip to content

Add tracing for AzureOpenAI clientΒ #18280

@bignoncedric

Description

@bignoncedric

Problem Statement

Currently OpenAI integration works only for vanilla open AI client OpenAI class in openai module.
The Azure OpenAI version is not instrumented despite being included in the openai module and exposing the same interface.

Solution Brainstorm

Slightly refactoring the packages/node/src/integrations/tracing/openai/instrumentation.ts to be able to patch the two clients may work:

  private _patch(exports: PatchedModuleExports): PatchedModuleExports | void {
    let result = exports;
    result = this._patchClient(result, 'OpenAI');
    result = this._patchClient(result, 'AzureOpenAI');
    return result;
  }

Additional Context

No response

Priority

React with πŸ‘ to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions