Dashboards API

Dashboard metrics, analytics, time series, and custom dashboard endpoints.

Dashboard Overview

GET
/api/v1/dashboard/overview

Get high-level dashboard summary

Returns aggregated metrics across all user projects including log counts, error rates, active users, and health status.

JSON
// Response
{
  "status": "success",
  "data": {
    "summary": {
      "totalLogs": 45230,
      "totalErrors": 520,
      "errorRate": 1.15,
      "totalProjects": 5,
      "averageResponseTime": 187
    },
    "health": {
      "healthyProjects": 4,
      "warningProjects": 1,
      "criticalProjects": 0
    },
    "realTime": {
      "activeUsers": 23,
      "currentRPS": 45
    },
    "topIssues": {
      "mostFrequentError": "TypeError: Cannot read properties",
      "slowestEndpoint": "/api/reports/generate"
    },
    "trends": {
      "logVolumeChange": 12.5,
      "errorRateChange": -2.3
    }
  }
}

Comprehensive Metrics

GET
/api/v1/dashboard/metrics

Get detailed metrics with time range filtering

ParameterTypeDescription
timeRangestring"1h", "24h", "7d", "30d" (default: "24h")
projectIdstringFilter by specific project (optional)

Real-Time Metrics

GET
/api/v1/dashboard/realtime

Get current real-time metrics

Returns live data including current request rate, active sessions, and most recent errors. This endpoint is optimized for frequent polling (every 10-30 seconds).

JSON
// Response
{
  "status": "success",
  "data": {
    "currentRPS": 45,
    "activeUsers": 23,
    "recentErrors": [
      {
        "message": "TypeError: Cannot read...",
        "timestamp": "2026-03-07T10:35:12Z",
        "count": 3
      }
    ],
    "uptimePercent": 99.97
  }
}

Time Series Data

GET
/api/v1/dashboard/timeseries

Get time-bucketed log data for charts

ParameterTypeDescription
timeRangestringTime range for the series
granularitystring"minute", "hour", "day"
metricstring"logCount", "errorRate", "responseTime"
JSON
// Response
{
  "status": "success",
  "data": {
    "series": [
      { "timestamp": "2026-03-07T00:00:00Z", "value": 1230 },
      { "timestamp": "2026-03-07T01:00:00Z", "value": 980 },
      { "timestamp": "2026-03-07T02:00:00Z", "value": 450 },
      { "timestamp": "2026-03-07T03:00:00Z", "value": 320 }
    ],
    "granularity": "hour",
    "metric": "logCount"
  }
}

Error Analysis

GET
/api/v1/dashboard/errors

Get error analysis and grouping data

Returns errors grouped by message, with occurrence counts, first/last seen timestamps, and affected environments.

Performance Metrics

GET
/api/v1/dashboard/performance

Get performance analysis data

JSON
// Response
{
  "status": "success",
  "data": {
    "averageResponseTime": 187,
    "p95ResponseTime": 450,
    "p99ResponseTime": 890,
    "slowestEndpoints": [
      { "endpoint": "/api/reports/generate", "responseTime": 2340 },
      { "endpoint": "/api/export/csv", "responseTime": 1870 }
    ],
    "pageLoadTimes": [
      { "page": "/dashboard", "loadTime": 1200 },
      { "page": "/logs", "loadTime": 980 }
    ],
    "networkStats": {
      "totalRequests": 45230,
      "failureRate": 0.8,
      "averageRequestTime": 145,
      "slowRequests": 23
    }
  }
}

Custom Dashboards

Create personalized dashboards with configurable widgets:

POST
/api/v1/custom-dashboards

Create a custom dashboard

JSON
// Request body
{
  "name": "Frontend Performance",
  "description": "Web vitals and page load metrics",
  "projectId": "proj_abc123",
  "widgets": [
    {
      "type": "timeseries",
      "title": "Page Load Times",
      "config": {
        "metric": "responseTime",
        "timeRange": "24h",
        "granularity": "hour"
      },
      "position": { "x": 0, "y": 0, "w": 6, "h": 4 }
    },
    {
      "type": "stat",
      "title": "Error Rate",
      "config": {
        "metric": "errorRate",
        "timeRange": "24h"
      },
      "position": { "x": 6, "y": 0, "w": 3, "h": 2 }
    }
  ]
}
GET
/api/v1/custom-dashboards

List user's custom dashboards

PUT
/api/v1/custom-dashboards/:id

Update a custom dashboard

DELETE
/api/v1/custom-dashboards/:id

Delete a custom dashboard

Data Export

POST
/api/v1/dashboard/export

Export dashboard data in various formats

JSON
// Request body
{
  "format": "csv",         // "csv" or "json"
  "timeRange": "7d",
  "projectId": "proj_abc123",
  "metrics": ["logCount", "errorRate", "responseTime"]
}

Info

Dashboard endpoints use Redis caching with a 5-minute TTL for expensive aggregation queries. Use the insights invalidation endpoint to force a cache refresh when needed: GET /api/v1/insights/:projectId/invalidate