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
Thedashboard 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
Scope
Scope
ChartType
ChartType
Metrics
Metrics
The
Metrics object defines what to measure and how to aggregate.Measure:Aggregation:
FilterConfig
FilterConfig
Filter
Filter
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, OBJECTDimension
Dimension
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
SortField
SortField
SortOrder
SortOrder
Response
iterSessionStats
Stream over all pages of session stats until completion. This iterator handles pagination automatically.Parameters
Response
Complete Example
Next Steps
- Usage Utilities - Query token usage and trace data
- TypeScript SDK Reference - Complete SDK documentation
- Custom Dashboard - Build custom dashboards
