Skip to main content
Version: v3.9.0

Status reporter

StatusReporter is the in-memory aggregation hub for module health and telemetry. It is started first among Supervisor modules and backs GET /v1/system/status, Field Agent status POST payloads, and portions of system info.

Code: internal/statusreporter/

Purpose​

  • Hold structured status objects for each major module
  • Track daemon lifecycle (STARTING, RUNNING, WARNING, ...)
  • Maintain modulesStatus[] array (fixed indexes; Resource Manager slot unused) for Supervisor reporting
  • Background worker for system time synchronization
  • Assemble composite status for API and Controller export

Dependencies​

Depends onReason
configHostname, version metadata
storeOptional runtime class listing for status enrichment
Used byReason
All major modulesUpdate*Status() callbacks
edgeletapi/handlers/status.goSystem status HTTP response
fieldagentStatus POST body construction
resourceconsumptionWrites CPU/memory/disk usage

Lifecycle​

Start​

First module in Supervisor start order:

  1. Initialize default status structs (NewSupervisorStatus(7), etc.)
  2. Start setSystemTimeWorker() goroutine

Stop​

Cancel context; wait for worker.

Module index mapping​

Supervisor updates SupervisorStatus.modulesStatus[i] using constants from internal/utils/constants.go:

IndexModule
0Resource Consumption Manager
1Process Manager
2Status Reporter
3EdgeletAPI
4Field Agent
5(unused: former Resource Manager; indexes are not reshuffled)
6GPS Manager

SupervisorStatus fields: daemonStatus, daemonLastStart, operationDuration, warningMessage.

Status object types​

GetterModel type
GetSupervisorStatusSupervisorStatus
GetProcessManagerStatusProcessManagerStatus
GetFieldAgentStatusFieldAgentStatus
GetEdgeletAPIStatusEdgeletAPIStatus
GetResourceConsumptionManagerStatusResource usage
GetSSHProxyManagerStatusSSH tunnel state
GetVolumeMountManagerStatusActive mount count

Process Manager status includes the per-microservice map (runtime state, errorMessage, lastError, lastErrorAt, restartCount), registry status, and running count.

Current errorMessage stays set until 30 seconds of continuous RUNNING, then is sent as "". lastError is the last crash text and is not cleared on recovery. For controller-managed workloads those last-crash fields are in-memory (lost on agent restart until the next failure). Local inspect may also surface SQLite last_error / restart_count.

External APIs​

SurfaceRole
GET /v1/system/statusPrimary operator view
Controller status POSTField Agent aggregates reporter state

External reporter helpers in reporter_external.go format Controller-compatible payloads.

Configuration​

No direct config keys; updated via module callbacks on config reload.

Observability​

  • Log module: "Status Reporter"
  • Module index: 2 (Status Reporter itself in the array)

Failure modes​

SymptomTypical cause
Stale module statusModule failed to update on stop
WARNING stuckEdge Guard or engine degraded; check warningMessage
Missing MS in statusProcess Manager not publishing map
Last crash gone after edgelet restartController-managed last-error is in-memory; next inspect/exit fills it
Dashboard still shows a crash after recoveryGrace window: errorMessage clears only after 30s continuous RUNNING

Code map​

FileRole
reporter.goSingleton, getters/updaters, system time worker
reporter_external.goController export formatting

Related: Supervisor, Field agent, Edgelet API module.

Group 3See anything wrong with the document? Help us improve it!