package models // TelemetryBatch is the payload of POST /back/telemetry. The client lives in // the telemetry/ module; keep both definitions in sync. type TelemetryBatch struct { Service string `json:"service"` Instance string `json:"instance"` Version string `json:"version"` StartedAt int64 `json:"startedAt"` HeartbeatIntervalSec int `json:"heartbeatIntervalSec"` Status string `json:"status"` StatusMessage string `json:"statusMessage"` Meta map[string]any `json:"meta"` Metrics []TelemetryMetric `json:"metrics"` Events []TelemetryEvent `json:"events"` } // TelemetryMetric is one sample. Type "counter" carries a delta since the last // push, "gauge" the current value, "summary" client-side pre-aggregated // Count/Sum/Min/Max. Ts is unix seconds or milliseconds, optional. type TelemetryMetric struct { Name string `json:"name"` Type string `json:"type"` Help string `json:"help"` Value float64 `json:"value"` Count int64 `json:"count"` Sum float64 `json:"sum"` Min float64 `json:"min"` Max float64 `json:"max"` Labels map[string]string `json:"labels"` Ts int64 `json:"ts"` } type TelemetryEvent struct { Level string `json:"level"` Message string `json:"message"` Ts int64 `json:"ts"` Fields map[string]any `json:"fields"` }