Analytics Endpoints
The analytics endpoints provide comprehensive query performance analytics, trend analysis, actionable insights, and resource consumption metrics. Served by AnalyticsController at /v1/analytics.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/analytics | Get comprehensive analytics |
| GET | /v1/analytics/summary | Get summary statistics |
| GET | /v1/analytics/trends/:metric | Get metric trend |
| GET | /v1/analytics/insights | Get actionable insights |
| GET | /v1/analytics/compare | Compare performance periods |
| GET | /v1/analytics/engines | Get engine statistics |
| GET | /v1/analytics/users | Get user statistics |
| GET | /v1/analytics/slow-queries | Get slow queries |
| GET | /v1/analytics/failed-queries | Get failed queries |
| GET | /v1/analytics/patterns | Get query patterns |
| GET | /v1/analytics/resources | Get resource metrics |
| GET | /v1/analytics/time-series | Get time series data |
| POST | /v1/analytics/insights/:insightId/acknowledge | Acknowledge insight |
GET /v1/analytics
Returns comprehensive query analytics for the tenant.
| Parameter | Type | Default | Description |
|---|---|---|---|
days | int | 7 | Number of days to analyze |
granularity | string | day | Time granularity: hour, day, week |
GET /v1/analytics/trends/:metric
Returns trend analysis for a specific metric.
Available metrics: queryCount, avgLatency, successRate, cacheHitRate.
| Parameter | Type | Default | Description |
|---|---|---|---|
days | int | 7 | Analysis window |
granularity | string | hour | Time granularity |
GET /v1/analytics/compare
Compares query performance between two time periods.
| Parameter | Type | Description |
|---|---|---|
period1Start | ISO-8601 | Start of first period |
period1End | ISO-8601 | End of first period |
period2Start | ISO-8601 | Start of second period |
period2End | ISO-8601 | End of second period |
GET /v1/analytics/slow-queries
Returns the top slow queries ranked by execution time.
| Parameter | Type | Default | Description |
|---|---|---|---|
days | int | 7 | Analysis window |
limit | int | 10 | Maximum results |
GET /v1/analytics/insights
Returns actionable recommendations for improving query performance, such as missing indexes, frequently failing patterns, and cache optimization opportunities.