Linkit

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/telemetry

Required Headers

HeaderDescription
AuthorizationAPI 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.

MetricTypeDescription
goroutinesintegerActive concurrent tasks
cpu_countintegerAvailable logical CPUs
alloc_mbintegerCurrently allocated heap memory (MB)
total_alloc_mbintegerCumulative memory ever allocated (MB)
sys_mbintegerTotal memory obtained from OS (MB)
num_gcintegerCompleted GC cycles
gc_pause_nsintegerLast 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.

MetricDescription
productsProduct catalog size
branchesNumber of locations
skusTotal SKUs (products × branches)
ordersOrder count
customersCustomer records

Staging Metrics

Data pipeline status.

MetricDescription
pendingItems waiting to be processed
processingItems currently being processed
completed_todayItems 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"
}