EdgeObservabilityAgent is a .NET 9 solution for collecting edge-node telemetry, buffering it locally during outages, and forwarding it to a lightweight HQ collector when connectivity is available.
-
EdgeObservabilityAgent/
Worker service that:- collects CPU, memory, and Docker container metrics every 5 seconds
- stores metrics in a local SQLite buffer (
edge_buffer.db) - attempts periodic resync to HQ (
http://localhost:5100) - renders a live terminal dashboard (interactive terminals only)
-
HqCollector/
Minimal ASP.NET Core API that:- exposes
GET /healthfor connectivity checks - accepts telemetry via
POST /ingest - exposes latest per-node snapshots via
GET /metrics
- exposes
EdgeObservabilityAgent.sln— solution entry containing both projectsEdgeObservabilityAgent/Program.cs— dependency registration and host startupEdgeObservabilityAgent/Worker.cs— metric collection loop and dashboard update flowEdgeObservabilityAgent/Services/BufferRepository.cs— SQLite buffering and sync state storageEdgeObservabilityAgent/Services/ResyncService.cs— connectivity checks and buffered payload resyncEdgeObservabilityAgent/Services/SystemMetricsService.cs— CPU/memory/Docker metric collectionEdgeObservabilityAgent/Services/DashboardService.cs— live terminal dashboard renderingEdgeObservabilityAgent/Models/MetricPayload.cs— payload/domain modelsEdgeObservabilityAgent/Protos/metrics.proto— protobuf schema for metricsHqCollector/Program.cs— minimal API with/health,/ingest, and/metrics
- .NET SDK 9.0+
- Docker (optional, for container telemetry)
From repository root:
dotnet restore EdgeObservabilityAgent.sln
dotnet build EdgeObservabilityAgent.slnOpen two terminals.
dotnet run --project HqCollector/HqCollector.csprojCollector listens on http://localhost:5100.
dotnet run --project EdgeObservabilityAgent/EdgeObservabilityAgent.csprojThe agent will:
- buffer payloads in SQLite
- detect HQ availability via
/health - flush buffered rows to
/ingestwhen connected
GET /health→ liveness checkPOST /ingest→ accepts JSON metric payloadGET /metrics→ returns latest payload and retained count per node
Primary payload fields include:
nodeIdtimestampcpuUsagememoryUsageMbmemoryTotalMbcontainers[](id,name,status,image)
See EdgeObservabilityAgent/Protos/metrics.proto for schema details.
- Resync polling runs every 2 seconds in batches of up to 50 records.
- Dashboard output is automatically suppressed in non-interactive environments.