Insights API
The Insights service provides SQL-based querying over your telemetry data.
Base URL: https://insights.nextepoch.cloud
Execute Query
POST /v1/queryHeaders:
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <your-jwt-token> |
Content-Type | Yes | application/json |
Request Body:
json
{
"sql": "SELECT * FROM logs WHERE level = 'error' LIMIT 10"
}| Field | Type | Required | Description |
|---|---|---|---|
sql | string | Yes | SQL query to execute |
Response:
json
{
"data": {
"columns": ["timestamp", "level", "message"],
"rows": [
["2025-01-15T10:30:00Z", "error", "Connection refused"],
["2025-01-15T10:31:00Z", "error", "Timeout exceeded"]
]
},
"meta": {
"row_count": 2,
"execution_time_ms": 42
}
}Available Tables
Data is automatically scoped to your organization.
| Table | Description |
|---|---|
logs | Structured log entries |
metrics | Numerical metric measurements |
traces | Distributed trace spans |
audit | Audit trail (security/compliance) |
SQL Features
Insights supports standard SQL including:
- Filtering:
WHERE,HAVING - Aggregation:
GROUP BY,COUNT,SUM,AVG,MIN,MAX - Sorting and limiting:
ORDER BY,LIMIT - Time functions:
NOW(),date_trunc(),INTERVAL - JSON attribute access:
attributes['key'],tags['key']
Health Check
GET /healthReturns service health status.