Skip to content

Instrument pydantic_ai.embeddings.Embedder with gen_ai.embeddings spans #5836

@ericapisani

Description

@ericapisani

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.

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