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 our vercel-ai integration.
  • The native cohere-ai SDK 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 via src/integrations/cohere.ts, registered in getTracingIntegrations(); runtime packages re-export from @sentry/server-utils.
  • Instrument CohereClientV2 (and legacy CohereClient): chat() / chatStream(), embed(), and rerank(), 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 the openai-compatible shim.

Source: getsentry/sentry-javascript