semantic-conventions
semantic-conventions copied to clipboard
Tool call arg counts for Gen AI tool call spans
Area(s)
area:gen-ai
What's missing?
There isn't yet a convention for reporting a summary of the arguments.
A summary of the arguments is useful where the details might be omitted.
Describe the solution you'd like
I'd like the following span attributes defined:
gen_ai.tool.positional_args.countgen_ai.tool.keyword_args.count
There is a draft PR related to Google Gen AI SDK instrumentation that illustrates how this might be used:
- https://github.com/open-telemetry/opentelemetry-python-contrib/pull/3446/
What if we capture the parameter names and parameter numbers.
For DB conventions, it's been like this.
From footnote 5 in the db attributes:
db.operation.parameter: If a parameter has no name and instead is referenced only by index, then
SHOULD be the 0-based index.
And the keys are used to make an attribute per parameter like db.query.parameter.<key>
Maybe we should consider providing a signature foo(bar: string, baz: Any) ?
or
code.function.arg.{key}:
code.function.arg.0 = "*"
code.function.arg.foo = "*"