Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding span for invoke agent #1900

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

gyliu513
Copy link
Member

@gyliu513 gyliu513 commented Feb 11, 2025

Fixes #1842 #1924

Changes

Please provide a brief description of the changes here.

Note: if the PR is touching an area that is not listed in the existing areas, or the area does not have sufficient domain experts coverage, the PR might be tagged as experts needed and move slowly until experts are identified.

Merge requirement checklist

@gyliu513 gyliu513 requested review from a team as code owners February 11, 2025 19:32
@gyliu513 gyliu513 requested a review from a team as a code owner February 11, 2025 19:33
@github-actions github-actions bot added the enhancement New feature or request label Feb 11, 2025
@xrmx
Copy link
Contributor

xrmx commented Feb 13, 2025

@gyliu513 this needs rebase after the experimental -> development rename

Copy link
Contributor

@lmolkova lmolkova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a few minor comments

@gyliu513 gyliu513 force-pushed the invoke branch 3 times, most recently from 1af7a29 to b704514 Compare February 13, 2025 18:00
@gyliu513
Copy link
Member Author

@lmolkova I think I have addressed all comments here, can you help review again? Thanks!


The `gen_ai.operation.name` SHOULD be `invoke_agent`.

The **span name** SHOULD be `invoke_agent {gen_ai.agent.name}`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since gen_ai.agent.name is rarely available for remote agents, I think we need to change it to

Suggested change
The **span name** SHOULD be `invoke_agent {gen_ai.agent.name}`.
The **span name** SHOULD be `invoke_agent {gen_ai.agent.name}` if `gen_ai.agent.name` is readily available. When `gen_ai.agent.name` is not available, it SHOULD be `invoke_agent`.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@gyliu513 gyliu513 force-pushed the invoke branch 4 times, most recently from ea49e28 to ef12e19 Compare March 6, 2025 20:36
@@ -47,22 +48,120 @@ Semantic conventions for individual GenAI systems and frameworks MAY specify dif
|---|---|---|---|---|---|
| [`gen_ai.operation.name`](/docs/attributes-registry/gen-ai.md) | string | The name of the operation being performed. [1] | `chat`; `text_completion`; `embeddings` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`gen_ai.system`](/docs/attributes-registry/gen-ai.md) | string | The Generative AI product as identified by the client or server instrumentation. [2] | `openai` | `Required` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`error.type`](/docs/attributes-registry/error.md) | string | Describes a class of error the operation ended with. [3] | `timeout`; `java.net.UnknownHostException`; `server_certificate_invalid`; `500` | `Conditionally Required` if the operation ended in an error | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added back

| [`server.port`](/docs/attributes-registry/server.md) | int | GenAI server port. [4] | `80`; `8080`; `443` | `Conditionally Required` If `server.address` is set. | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| [`gen_ai.request.encoding_formats`](/docs/attributes-registry/gen-ai.md) | string[] | The encoding formats requested in an embeddings operation, if specified. [5] | `["base64"]`; `["float", "binary"]` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`gen_ai.request.frequency_penalty`](/docs/attributes-registry/gen-ai.md) | double | The frequency penalty setting for the GenAI request. | `0.1` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
| [`gen_ai.request.max_tokens`](/docs/attributes-registry/gen-ai.md) | int | The maximum number of tokens the model generates for a request. | `100` | `Recommended` | ![Development](https://img.shields.io/badge/-development-blue) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this attribute (or gen_ai.request.choice.count) applies to create_agent span - it seems one of the latest commits has added a lot of common attributes that aren't relevant on create_agent

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When create agent, some request parameters can be specified, and gen_ai.request.choice.count is just one of the parameter for request, can you elaborate more why this cannot apply to agent creation?

gyliu513 added 2 commits March 6, 2025 18:53
Signed-off-by: Guangya Liu <gyliu@ibm.com>
@gyliu513
Copy link
Member Author

@lmolkova can you help review this again? The major change is in https://github.com/open-telemetry/semantic-conventions/pull/1900/files#diff-5183ed68de81fe666274b64e46e9c3f9fc6ea6c358abd6f9b3b3f9cb3f1c7a13 and other files are auto generated, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Awaiting SIG approval
Development

Successfully merging this pull request may close these issues.

AI Agent Semantic Convetion: Agent invoke
3 participants