Viewing Agents
Access the Agents view from Observability → Agents in the Netra dashboard. For each agent, Netra displays:| Field | Description |
|---|---|
| Agent Name | The name assigned via the @agent decorator or manual span |
| Total Traces | Number of traces where this agent was invoked |
| First Event | Timestamp of the agent’s first recorded invocation |
| Last Event | Timestamp of the agent’s most recent activity |
Agent Actions
Each agent card provides two actions:- View Traces - Opens the Traces view filtered to this agent, showing all executions, inputs, outputs, latency, and cost
- Tools - Opens a modal listing tools invoked by the agent and their call counts
Configuring Agents
Agents are automatically tracked when you use the@agent decorator or create spans with SpanType.AGENT.
Using the Agent Decorator
The@agent decorator is the recommended way to define agents. It automatically creates spans with the correct type and tracks agent activity.
Decorating Agent Classes
You can also decorate entire classes. All public methods will be instrumented as part of the agent.Manual Agent Spans
For more control, create agent spans manually:Agent with Tools
Track which tools your agent uses by nesting@task or SpanType.TOOL spans within agent spans:
web-search and summarize-results.
Best Practices
-
Use descriptive agent names - Names like
customer-support-agentorcode-review-agentare more useful thanagent1 -
Nest tools within agents - Use
@taskfor tools to track which tools each agent uses - Add custom attributes - Include relevant context like input queries, user intent, or decision outcomes
- Use classes for stateful agents - The class decorator tracks all methods as part of the agent
Next Steps
- Decorators - Full decorator reference
- Manual Tracing - Create custom spans
- Users - Track users interacting with your agents
- Sessions - Group agent interactions by session