getsentry / getsentry/sentry-python

Instrument `pydantic_ai.embeddings.Embedder` with `gen_ai.embeddings` spans

未關閉
#5,836 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
Improvement Python Spans
主要語言
Python
星號
2.2k
分支
669
平均合併
1 天 40 分鐘
30 天內合併 PR
212

描述

`Embedder.embed()`, `embed_query()`, and `embed_documents()` (and their sync variants) make model calls with no spans today.

OTel defines `gen_ai.embeddings` as a valid `gen_ai.operation.name` and we already have `OP.GEN_AI_EMBEDDINGS` defined in `sentry_sdk/consts.py`. Should create `gen_ai.embeddings` spans with model name, system, and token usage attributes.

貢獻指南

開啟貢獻指南

研究方向

Start with pydantic_ai.embeddings.Embedder.embed(), embed_query(), embed_documents(), and their sync variants, then inspect OP.GEN_AI_EMBEDDINGS in sentry_sdk/consts.py. Trace how model calls are instrumented and add spans with the requested model name, system, and token usage attributes; done means all listed methods emit gen_ai.embeddings spans.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
observability
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。