openllmetry-js
openllmetry-js copied to clipboard
feat(cerebras): new instrumentation package
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
CerebrasInstrumentationclass ininstrumentation.tsfor 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:
CerebrasInstrumentationConfigintypes.tsallows configuration of trace content logging and exception logging.- Build:
rollup.config.jssets up build process with TypeScript and JSON plugins.- Tests:
instrumentation.test.tsincludes tests for span attribute setting for both chat and completion requests, including streaming.This description was created by
for fe99b2c8be3d962a9676593a7d8cb602c10a4fc8. You can customize this summary. It will automatically update as commits are pushed.