Skip to content

Insights API

The Insights service provides SQL-based querying over your telemetry data.

Base URL: https://insights.nextepoch.cloud

Execute Query

POST /v1/query

Headers:

HeaderRequiredDescription
AuthorizationYesBearer <your-jwt-token>
Content-TypeYesapplication/json

Request Body:

json
{
  "sql": "SELECT * FROM logs WHERE level = 'error' LIMIT 10"
}
FieldTypeRequiredDescription
sqlstringYesSQL 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.

TableDescription
logsStructured log entries
metricsNumerical metric measurements
tracesDistributed trace spans
auditAudit 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 /health

Returns service health status.

NextEpoch Cloud Documentation