Skip to content

feat: add experimental docker collector from STATE_DB#12

Merged
rokernel merged 1 commit intomasterfrom
feat/docker-collector-experimental
Feb 25, 2026
Merged

feat: add experimental docker collector from STATE_DB#12
rokernel merged 1 commit intomasterfrom
feat/docker-collector-experimental

Conversation

@rokernel
Copy link
Owner

@rokernel rokernel commented Feb 25, 2026

Summary

  • add a new experimental docker_collector that reads SONiC STATE_DB DOCKER_STATS|* entries with background cache refresh and default disabled (DOCKER_ENABLED=false)
  • export per-container CPU, memory, network, block IO, and PID metrics with a single container label, plus collector/source health metrics (source_stale, entries_skipped, cache/scrape duration)
  • wire collector registration in main, add fixture coverage and unit tests, and document config + usage in README.md

Safety and behavior

  • read-only implementation (Redis reads only, no Docker socket access, no command execution)
  • cap exported series with DOCKER_MAX_CONTAINERS
  • track source freshness with DOCKER_SOURCE_STALE_THRESHOLD
  • tolerate LastUpdateTime field/timestamp format differences across SONiC versions

Validation

  • go test ./...
  • go build ./...
  • runtime checks on two lab SONiC switches succeeded:
    • sonic_docker_collector_success reported healthy
    • sonic_docker_containers exported non-zero values
    • sonic_docker_entries_skipped stayed at expected baseline
    • sonic_docker_source_stale indicated fresh source data

@rokernel rokernel merged commit acb00d7 into master Feb 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant