Skip to content

GenAI utils | Invoke Agent demo app#4340

Closed
etserend wants to merge 17 commits intoopen-telemetry:mainfrom
etserend:genai-utils/invoke-agent-demo
Closed

GenAI utils | Invoke Agent demo app#4340
etserend wants to merge 17 commits intoopen-telemetry:mainfrom
etserend:genai-utils/invoke-agent-demo

Conversation

@etserend
Copy link
Copy Markdown

@etserend etserend commented Mar 17, 2026

Description

Adds AgentInvocation type and agent() context manager to opentelemetry-util-genai, enabling instrumentation of agent invocation lifecycle events with OpenTelemetry spans following the GenAI agent semantic conventions.

This is the second in a series of PRs adding agent lifecycle telemetry (following create_agent in #4217).

Example trace output:

Trace (e71e16deb2ecd162e3f4fc67c240818b)
└── invoke_agent Currency Exchange Agent (4.16s, Client)
    ├── gen_ai.operation.name: invoke_agent
    ├── gen_ai.agent.name: Currency Exchange Agent
    ├── gen_ai.agent.description: Currency exchange agent demo
    ├── gen_ai.provider.name: gcp_vertex_ai
    ├── gen_ai.request.model: gemini-2.5-flash
    ├── gen_ai.response.finish_reasons: ["stop"]
    ├── gen_ai.usage.input_tokens: 12
    ├── gen_ai.usage.output_tokens: 87
    ├── server.address: us-central1-aiplatform.googleapis.com
    │
    └── chat gemini-2.5-flash (4.12s, Client)
        ├── gen_ai.operation.name: chat
        ├── gen_ai.system: vertex_ai
        ├── gen_ai.request.model: gemini-2.5-flash
        ├── gen_ai.response.model: gemini-2.5-flash
        ├── gen_ai.response.finish_reasons: ["stop"]
        ├── gen_ai.usage.input_tokens: 12
        ├── gen_ai.usage.output_tokens: 87
        ├── server.address: us-central1-aiplatform.googleapis.com
        └── server.port: 443

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment.
If you're still working on this, please add a comment or push new commits.

@github-actions github-actions Bot added the Stale label Apr 1, 2026
@github-actions
Copy link
Copy Markdown

This PR has been closed due to inactivity. Please reopen if you would like to continue working on it.

@github-actions github-actions Bot closed this Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants