Skip to content

feat(cohere): Instrument rerank method #5842

@ericapisani

Description

@ericapisani

The Cohere SDK's rerank method (ranks documents by relevance to a query) is not instrumented. This is a significant AI operation with token costs that should be tracked.

Needs a new span operation — no existing gen_ai.* OP constant covers reranking.

Acceptance criteria:

  • rerank calls emit spans with model, token usage, and input/output data
  • Follows gen_ai.* attribute conventions (not deprecated ai.*)
  • Sets gen_ai.system = "cohere"

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions