Skip to content

feat: trace provider interface#140

Merged
afarntrog merged 5 commits intostrands-agents:mainfrom
afarntrog:trace_provider
Feb 20, 2026
Merged

feat: trace provider interface#140
afarntrog merged 5 commits intostrands-agents:mainfrom
afarntrog:trace_provider

Conversation

@afarntrog
Copy link
Copy Markdown
Contributor

@afarntrog afarntrog commented Feb 16, 2026

Description

Add TraceProvider interface for observability backends

Add abstract TraceProvider that retrieves agent trace data from
observability backends and returns Session/Trace types the evals
system already consumes.

  • TraceProvider ABC with get_session() (required), list_sessions()
    and get_session_by_trace_id() (optional, raise NotImplementedError)
  • SessionFilter dataclass for time-range and limit-based discovery
  • Exception hierarchy: TraceProviderError base with
    SessionNotFoundError, TraceNotFoundError, ProviderError
  • Export providers module from strands_evals package

Related Issues

#97

Documentation PR

Type of Change

New feature

Testing

How have you tested the change? Verify that the changes do not break functionality or introduce warnings in consuming repositories: agents-docs, agents-tools, agents-cli

  • I ran hatch run prepare

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Introduce an abstract TraceProvider base class for retrieving agent
trace data from observability backends for evaluation. This includes:

- TraceProvider ABC with get_session, list_sessions, and
  get_session_by_trace_id methods
- SessionFilter dataclass for filtering session discovery
- Custom error hierarchy (TraceProviderError, SessionNotFoundError,
  TraceNotFoundError, ProviderError)
- Session and Trace data types with span tree construction and
  convenience accessors (input/output messages, token usage, duration)
- New providers module exposed at package level
- Comprehensive unit tests for providers and trace types
Add abstract TraceProvider that retrieves agent trace data from
observability backends and returns Session/Trace types the evals
system already consumes.

- TraceProvider ABC with get_session() (required), list_sessions()
  and get_session_by_trace_id() (optional, raise NotImplementedError)
- SessionFilter dataclass for time-range and limit-based discovery
- Exception hierarchy: TraceProviderError base with
  SessionNotFoundError, TraceNotFoundError, ProviderError
- Export providers module from strands_evals package
@afarntrog afarntrog changed the title Trace provider interface feat: Trace provider interface Feb 16, 2026
@afarntrog afarntrog changed the title feat: Trace provider interface feat: trace provider interface Feb 16, 2026
Add abstract TraceProvider that retrieves agent trace data from
observability backends and returns Session/Trace types the evals
system already consumes.

- TraceProvider ABC with get_session() (required), list_sessions()
  and get_session_by_trace_id() (optional, raise NotImplementedError)
- SessionFilter dataclass for time-range and limit-based discovery
- Exception hierarchy: TraceProviderError base with
  SessionNotFoundError, TraceNotFoundError, ProviderError
- Export providers module from strands_evals package
JackYPCOnline
JackYPCOnline previously approved these changes Feb 17, 2026
…sionFilter

Remove SessionFilter dataclass, list_sessions(), and
get_evaluation_data_by_trace_id() from TraceProvider to keep the
interface minimal. Only the core get_evaluation_data() abstract method
remains. Associated tests and public exports are updated accordingly.
@afarntrog
Copy link
Copy Markdown
Contributor Author

Discussion on how to further expand this interface in the future: #143

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.

3 participants