openllmetry-js icon indicating copy to clipboard operation
openllmetry-js copied to clipboard

feat(cerebras): new instrumentation package

Open airhorns opened this issue 7 months ago • 1 comments

This adds an instrumentation for the https://github.com/Cerebras/cerebras-cloud-sdk-node inference SDK. The SDK is similar to the Anthropic one, though less featureful and just different enough to be annoying. I've recorded polly recordings with my own API key that should prove its all working as expected though.


[!IMPORTANT] Add Cerebras instrumentation package for OpenTelemetry, supporting chat and completion requests with span attribute recording.

  • Behavior:
    • Adds CerebrasInstrumentation class in instrumentation.ts for handling Cerebras SDK requests.
    • Supports both chat and completion requests, with streaming and non-streaming options.
    • Records spans with attributes like model, max tokens, and prompt content.
  • Configuration:
    • CerebrasInstrumentationConfig in types.ts allows configuration of trace content logging and exception logging.
  • Build:
    • rollup.config.js sets up build process with TypeScript and JSON plugins.
  • Tests:
    • instrumentation.test.ts includes tests for span attribute setting for both chat and completion requests, including streaming.

This description was created by Ellipsis for fe99b2c8be3d962a9676593a7d8cb602c10a4fc8. You can customize this summary. It will automatically update as commits are pushed.

airhorns avatar Apr 19 '25 02:04 airhorns

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Apr 19 '25 02:04 CLAassistant