getsentry / getsentry/sentry-python
feat(cohere): Instrument `rerank` method
Abierto
Improvement
Python
Spans
- Lenguaje dominante
- Python
- Estrellas
- 2.2k
- Forks
- 669
- Merge medio
- 1 d 1 h
- PR fusionados (30 d)
- 213
Descripción
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"`
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.