Telemetry
Runtime performance metrics and system observability
Telemetry
Real-time runtime metrics for monitoring, debugging, and capacity planning. Returns Go runtime stats, data store counts, and pipeline status.
Get Telemetry
GET /api/v1/telemetryRequired Headers
| Header | Description |
|---|---|
Authorization | API key |
Example Request
curl -X GET "https://linkit.works/api/v1/telemetry" \
-H "Authorization: your_api_key_here"const response = await fetch('https://linkit.works/api/v1/telemetry', {
headers: { 'Authorization': 'your_api_key_here' }
});
const telemetry = await response.json();import requests
response = requests.get(
'https://linkit.works/api/v1/telemetry',
headers={'Authorization': 'your_api_key_here'}
)
telemetry = response.json()Response
{
"version": "1.0.0",
"measured": "2024-01-15T10:30:00Z",
"runtime": {
"goroutines": 42,
"cpu_count": 8,
"alloc_mb": 128,
"total_alloc_mb": 4096,
"sys_mb": 256,
"num_gc": 156,
"gc_pause_ns": 1234567
},
"store": {
"products": 15000,
"branches": 25,
"skus": 375000,
"orders": 50000,
"customers": 12000
},
"staging": {
"pending": 0,
"processing": 12,
"completed_today": 5432
}
}Runtime Metrics
Go runtime performance data.
| Metric | Type | Description |
|---|---|---|
goroutines | integer | Active concurrent tasks |
cpu_count | integer | Available logical CPUs |
alloc_mb | integer | Currently allocated heap memory (MB) |
total_alloc_mb | integer | Cumulative memory ever allocated (MB) |
sys_mb | integer | Total memory obtained from OS (MB) |
num_gc | integer | Completed GC cycles |
gc_pause_ns | integer | Last GC pause duration (nanoseconds) |
goroutines: Should stabilize under load. Unbounded growth may indicate a goroutine leak. alloc_mb: Spikes during heavy operations are normal. Constant growth suggests a memory leak. gc_pause_ns: Under 1ms (1,000,000 ns) is normal. Over 10ms may affect request latency.
Store Metrics
Approximate record counts, refreshed periodically. Use for dashboards and capacity planning, not exact inventory counts.
| Metric | Description |
|---|---|
products | Product catalog size |
branches | Number of locations |
skus | Total SKUs (products × branches) |
orders | Order count |
customers | Customer records |
Staging Metrics
Data pipeline status.
| Metric | Description |
|---|---|
pending | Items waiting to be processed |
processing | Items currently being processed |
completed_today | Items processed since midnight UTC |
Pipeline health
If pending keeps growing while processing stays low, the pipeline may be stalled.
Best Practices
- Poll every 15–30 seconds. More frequent polling adds unnecessary load.
- Set a 10-second request timeout.
- Handle failures gracefully — don't crash monitoring if a single request fails.
- Store historical data for trend analysis.
- Alert on sustained trends, not individual spikes.
Error Responses
401 Unauthorized
{
"code": 401,
"error": "Unauthorized",
"details": "Valid API key required"
}