Skip to main content
The Netra SDK exposes a dashboard client that lets you perform dashboard queries and retrieve relevant data programmatically. This page shows how to use Netra.dashboard to craft dashboard queries, fetch session summaries, retrieve session statistics, and load full session details.

Getting Started

The dashboard client is available on the main Netra entry point after initialization.

query_data

Fetch dashboard data with customizable metrics, dimensions, and filters. This method supports various chart types and aggregation strategies.

Parameters

Enums and Types

The Metrics object defines what to measure and how to aggregate.Measure:Aggregation:
FilterField values: TOTAL_COST, SERVICE, TENANT_ID, USER_ID, SESSION_ID, ENVIRONMENT, LATENCY, MODEL_NAME (Spans only), MODELS (Traces only), METADATAOperator values: EQUALS, NOT_EQUALS, CONTAINS, NOT_CONTAINS, STARTS_WITH, ENDS_WITH, GREATER_THAN, LESS_THAN, GREATER_EQUAL_TO, LESS_EQUAL_TO, ANY_OF, NONE_OFType values: STRING, NUMBER, BOOLEAN, ARRAY_OPTIONS, OBJECT
DimensionField values:
If the query scope is Scope.TRACES, only DimensionField.ENVIRONMENT is supported. The Scope.SPANS supports all dimension fields.

get_session_summary

Retrieve aggregated session metrics including total sessions, costs, latency, and cost breakdown by model.

Parameters

SessionFilterConfig

SessionFilter (Optional)

Response


get_session_details

Retrieve full details for a single session, including every trace with tokens, costs, models, inputs/outputs, and tool calls.
get_session_details is available in the Python SDK only.

Parameters

Response


get_session_stats

Fetch a paginated list of sessions with individual session metrics including request count, cost, and duration.

Parameters

Sorting Options

Response

iter_session_stats

Stream over all pages of session stats until completion. This iterator handles pagination automatically.

Parameters

Response

Use iter_session_stats when you need to process all sessions without manually handling pagination. The iterator fetches pages on-demand as you iterate.

Complete Example

Next Steps

Last modified on July 31, 2026