Skip to content

feat(closes OPEN-9557): add 'promote' parameter to the trace decorator#614

Merged
gustavocidornelas merged 1 commit intomainfrom
cid/promote-kwargs
Mar 12, 2026
Merged

feat(closes OPEN-9557): add 'promote' parameter to the trace decorator#614
gustavocidornelas merged 1 commit intomainfrom
cid/promote-kwargs

Conversation

@gustavocidornelas
Copy link
Contributor

Pull Request

Summary

Introduces a promote kwarg in the @trace() decorator. This kwarg can be used to surface any of the traced functions kwargs to the row-level. This feature is useful for users who want to filter or create tests that target these promoted values.

There are two ways to use it:

  1. Passing a list of kwargs to promote:
# In this case, `tool_call_count` and `user_query` will appear in the row-level, even if `my_func` is deeply nested
@trace(promote=["tool_call_count", "user_query"])
def my_func(user_query: str, tool_call_count: int, other_kwarg: bool):
    pass
  1. Passing a dict to promote, to alias the columns
# In this case, `tool_call_count` is aliased to `tools` and `user_query` is aliased to `query`
@trace(promote={"tool_call_count": "tools", "user_query": "query"})
def my_func(user_query: str, tool_call_count: int, other_kwarg: bool):
    pass

Changes

  • Added the promote to all trace decorators (e.g., trace, trace_async, etc.) and piped the data through

Context

OPEN-9557: Add promote parameter to the trace decorator

Testing

  • Manual testing

@gustavocidornelas gustavocidornelas merged commit f57fe5f into main Mar 12, 2026
5 checks passed
@gustavocidornelas gustavocidornelas deleted the cid/promote-kwargs branch March 12, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants