Add instrumentation for Cohere (cohere-ai)
Author: mydeaCreated Sep 18, 2026Updated Sep 18, 2026
LabelsFeatureSpansjavascriptNode.js
Add native gen-AI instrumentation for the Cohere Node SDK, cohere-ai (repo).
Coverage status
@ai-sdk/cohere(Vercel AI SDK provider, ~3.2M/mo) is already covered by proxy through ourvercel-aiintegration.- The native
cohere-aiSDK is not covered. This issue tracks that path.
Relevance (npm)
cohere-ai: ~1.9M downloads/month (~20.3M last year) — roughly flat-to-modest growth. Cohere is a notable enterprise/RAG-focused provider (chat, embeddings, and rerank), and rerank in particular has no equivalent in the providers we instrument today.
Rough scope
- Add instrumentation logic under
packages/server-utils/src/ai/cohere/and wire it up viasrc/integrations/cohere.ts, registered ingetTracingIntegrations(); runtime packages re-export from@sentry/server-utils. - Instrument
CohereClientV2(and legacyCohereClient):chat()/chatStream(),embed(), andrerank(), including streaming. - Emit
gen_ai.*spans per the span attribute conventions (gen_ai.provider.name = cohere, request/response model, token usage, finish reasons). - Cohere is not OpenAI wire-compatible, so it needs bespoke instrumentation (like
mistral/anthropic), not theopenai-compatibleshim.
Source: getsentry/sentry-javascript