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, and retrieve session statistics.

Getting Started

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

queryData

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_OFFilterType 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.

getSessionSummary

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

Parameters

SessionFilterConfig

SessionFilter (Optional)

| value | string[] | List of values to match |

Response


getSessionStats

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

Parameters

Sorting Options

Response


iterSessionStats

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

Parameters

Response

Use iterSessionStats 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 March 17, 2026