Skip to content

Telemetry API

API reference for querying and ingesting telemetry data

The Telemetry API allows you to query errors, metrics, and traces collected by Cased. All endpoints require authentication with an API key.

Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Returns all telemetry projects for your organization.

GET /api/v1/telemetry/projects/

Terminal window
curl -X GET https://app.cased.com/api/v1/telemetry/projects/ \
-H "Authorization: Bearer YOUR_API_KEY"
{
"projects": [
{
"id": "2qNyVcXdPmE8K4L6R9T1W3Y5",
"name": "production-api",
"dsn": "https://abc123@telemetry.cased.com/1",
"is_active": true,
"created_at": "2025-01-10T10:00:00Z"
}
]
}

Creates a new telemetry project and returns a DSN for the Sentry SDK.

POST /api/v1/telemetry/projects/

FieldTypeDescription
namestringRequired. Project name (e.g., “production-api”)
Terminal window
curl -X POST https://app.cased.com/api/v1/telemetry/projects/ \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "my-service"}'
{
"id": "2qNyVcXdPmE8K4L6R9T1W3Y5",
"name": "my-service",
"dsn": "https://abc123def456@telemetry.cased.com/1",
"is_active": true,
"created_at": "2025-01-10T10:00:00Z"
}

Returns error events with optional filtering.

GET /api/v1/telemetry/query/errors/

ParameterTypeDefaultDescription
sincestring24hTime range: 1h, 6h, 24h, 7d, 30d
project_idstring-Filter by telemetry project
levelstring-Filter by level: error, warning, info
searchstring-Search in error message
limitinteger100Max results (1-1000)
offsetinteger0Pagination offset
Terminal window
curl -X GET "https://app.cased.com/api/v1/telemetry/query/errors/?since=24h&level=error&limit=10" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"events": [
{
"event_id": "abc123",
"timestamp": "2025-01-10T15:30:00Z",
"level": "error",
"message": "Connection timeout",
"exception_type": "TimeoutError",
"exception_value": "Connection to database timed out after 30s",
"platform": "python",
"sdk_name": "sentry.python",
"tags": {
"environment": "production",
"service": "api"
},
"stack_trace": "Traceback (most recent call last):\n File \"app.py\", line 42..."
}
],
"total": 156,
"has_more": true
}

Returns container metrics from cased-agent.

GET /api/v1/telemetry/query/metrics/

ParameterTypeDefaultDescription
sincestring1hTime range: 5m, 15m, 1h, 6h, 24h
clusterstring-Filter by cluster ID
namespacestring-Filter by Kubernetes namespace
podstring-Filter by pod name (prefix match)
containerstring-Filter by container name
metricstring-Filter by metric name
Terminal window
curl -X GET "https://app.cased.com/api/v1/telemetry/query/metrics/?since=1h&namespace=production&metric=cpu_usage_cores" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"metrics": [
{
"timestamp": "2025-01-10T15:30:00Z",
"cluster": "prod",
"namespace": "production",
"pod": "api-server-abc123",
"container": "api",
"metric_name": "cpu_usage_cores",
"value": 0.45
}
],
"total": 1250
}

Returns distributed traces and spans.

GET /api/v1/telemetry/query/traces/

ParameterTypeDefaultDescription
sincestring1hTime range
project_idstring-Filter by telemetry project
servicestring-Filter by service name
operationstring-Filter by operation name
min_duration_msinteger-Filter by minimum duration
limitinteger100Max results
Terminal window
curl -X GET "https://app.cased.com/api/v1/telemetry/query/traces/?since=1h&service=api&min_duration_ms=1000" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"traces": [
{
"trace_id": "abc123def456",
"root_span": {
"span_id": "span123",
"service": "api",
"operation": "POST /users",
"duration_ms": 1250,
"status": "ok",
"timestamp": "2025-01-10T15:30:00Z"
},
"span_count": 5,
"services": ["api", "database", "cache"]
}
],
"total": 42
}

Returns aggregate statistics for telemetry data.

GET /api/v1/telemetry/query/stats/

ParameterTypeDefaultDescription
sincestring24hTime range
project_idstring-Filter by project
Terminal window
curl -X GET "https://app.cased.com/api/v1/telemetry/query/stats/?since=24h" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"stats": {
"events": {
"total": 15234,
"errors": 342,
"warnings": 1205,
"info": 13687
},
"metrics": {
"total": 125000,
"containers": 45,
"pods": 23
},
"traces": {
"total": 8500,
"avg_duration_ms": 145
}
},
"period": {
"start": "2025-01-09T15:30:00Z",
"end": "2025-01-10T15:30:00Z"
}
}

These endpoints are typically used by SDKs, not called directly.

POST /api/<project_id>/envelope/

Used by the Sentry SDK. Configure your DSN and the SDK handles this automatically.

POST /api/v1/telemetry/metrics

Used by cased-agent to send container metrics.

HeaderDescription
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json
{
"metrics": [
{
"timestamp": "2025-01-10T15:30:00Z",
"cluster": "prod",
"namespace": "production",
"pod": "api-server-abc123",
"container": "api",
"node": "ip-10-0-1-100",
"metrics": {
"cpu_usage_cores": 0.45,
"memory_usage_bytes": 536870912,
"network_rx_bytes": 1048576,
"network_tx_bytes": 524288
}
}
]
}

POST /api/v1/telemetry/spans

Used to ingest distributed tracing spans.

{
"spans": [
{
"trace_id": "abc123def456",
"span_id": "span123",
"parent_span_id": null,
"service": "api",
"operation": "POST /users",
"start_time": "2025-01-10T15:30:00Z",
"duration_ms": 125,
"status": "ok",
"attributes": {
"http.method": "POST",
"http.url": "/users"
}
}
]
}

These endpoints provide cluster-wide views of your infrastructure, aggregating metrics across all nodes and pods.

Returns a high-level summary of cluster health including CPU, memory, pod counts, and active issues.

GET /api/v1/telemetry/query/cluster/overview/

ParameterTypeDefaultDescription
hours_backinteger1Hours to look back (1-24)
Terminal window
curl -X GET "https://app.cased.com/api/v1/telemetry/query/cluster/overview/?hours_back=1" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"hours_back": 1,
"cluster": {
"node_count": 5,
"total_pods": 42,
"cpu_used_percent": 35.2,
"memory_used_percent": 58.4,
"memory_total_gb": 80.0,
"memory_used_gb": 46.7
},
"nodes": {
"ip-10-0-1-100": {
"cpu_used_percent": 42.1,
"memory_used_percent": 65.3
}
},
"pods_by_namespace": {
"production": 25,
"staging": 12,
"kube-system": 5
},
"issues": {
"crashloops": 0,
"warnings": 3,
"total": 3
},
"http": {
"error_rate": 0.5,
"latency_p95": 145.2,
"request_count": 15234
}
}

Compares metrics across all nodes to identify imbalances or hot spots.

GET /api/v1/telemetry/query/cluster/nodes/

ParameterTypeDefaultDescription
hours_backinteger1Hours to look back (1-24)
Terminal window
curl -X GET "https://app.cased.com/api/v1/telemetry/query/cluster/nodes/?hours_back=1" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"hours_back": 1,
"node_count": 5,
"nodes": {
"ip-10-0-1-100": {
"cpu_used_percent": {"avg": 42.1, "min": 30.5, "max": 65.2},
"memory_used_percent": {"avg": 65.3, "min": 60.1, "max": 72.0},
"memory_total_gb": 16.0,
"pod_count": 12
}
},
"rankings": {
"by_cpu_usage": ["ip-10-0-1-100", "ip-10-0-1-101", "ip-10-0-1-102"],
"by_memory_usage": ["ip-10-0-1-101", "ip-10-0-1-100", "ip-10-0-1-102"]
},
"hottest_node": "ip-10-0-1-100"
}

Identifies the pods consuming the most CPU or memory across the cluster.

GET /api/v1/telemetry/query/cluster/top/

ParameterTypeDefaultDescription
resourcestringcpuResource type: cpu or memory
hours_backinteger1Hours to look back (1-24)
limitinteger10Number of results (1-50)
Terminal window
curl -X GET "https://app.cased.com/api/v1/telemetry/query/cluster/top/?resource=cpu&limit=5" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"resource": "cpu",
"hours_back": 1,
"limit": 5,
"top_consumers": [
{
"namespace": "production",
"pod": "api-server-abc123",
"avg_percent": 85.2,
"max_percent": 98.1
},
{
"namespace": "production",
"pod": "worker-xyz789",
"avg_percent": 72.1,
"max_percent": 89.5
}
],
"by_namespace": {
"production": {"avg": 45.2, "pod_count": 25},
"staging": {"avg": 22.1, "pod_count": 12}
}
}

EndpointLimit
Query endpoints100 requests/minute
Ingestion endpoints1000 requests/minute

Rate limit headers are included in responses:

  • X-RateLimit-Limit: Request limit
  • X-RateLimit-Remaining: Remaining requests
  • X-RateLimit-Reset: Reset timestamp