Repository navigation
[opentelemetry-instrumentation-genai-agno] Add instrumentation for agno embedding methods - #738
Conversation
1068df3 to
fe4237c
Compare
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Pull request overview
Adds OpenTelemetry tracing for Agno embedding operations, including built-in and user-defined embedder classes.
Changes:
- Wraps synchronous and asynchronous embedding methods and records model, provider, dimensions, usage, and errors.
- Adds nested-call suppression and support for custom embedder subclasses created at runtime.
- Adds unit tests, README documentation, and a changelog entry.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
instrumentation/opentelemetry-instrumentation-genai-agno/tests/test_embedder.py |
Adds coverage for sync, async, nested, usage, error, and uninstrumentation behavior. |
instrumentation/opentelemetry-instrumentation-genai-agno/src/opentelemetry/instrumentation/genai/agno/patch.py |
Adds embedder discovery, monkey-patching, tracing wrappers, and telemetry extraction. |
instrumentation/opentelemetry-instrumentation-genai-agno/README.rst |
Documents the newly instrumented embedder methods. |
instrumentation/opentelemetry-instrumentation-genai-agno/.changelog/738.added |
Records the new embedder instrumentation feature. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Pull request dashboard statusWaiting on reviewers · refreshed 2026-10-17 01:44 UTC Review the latest changes. Status above doesn't look right?
|
e72d878 to
7c0f49d
Compare
| _ACTIVE_FOREGROUND_WORKFLOWS: contextvars.ContextVar[frozenset[int]] = ( | ||
| contextvars.ContextVar("_ACTIVE_FOREGROUND_WORKFLOWS", default=frozenset()) | ||
| ) | ||
| _SUPPRESS_EMBEDDING: contextvars.ContextVar[bool] = contextvars.ContextVar( |
There was a problem hiding this comment.
good point that we have the duplicate embedding issue here too.. but this was added to resolve the issue that the embedding methods within agno itself can call eachother.. (ex get_embedding can call get_embedding_and_usage)... in this case i think it makes sense to disable the monkey patching altogether from the nested call when we detect it.. WDYT ?
3a1a6f5 to
c503008
Compare
…no embedding methods (#738)
c503008 to
81e4b3a
Compare
Description
Monkey patch the built in
get_embeddingmethods. Use a ContextVar (_SUPPRESS_EMBEDDING) to avoid double instrumenting in cases where one monkey patched embedding method delegates to another which can happen.Type of change
How has this been tested?
Unit tests
Checklist