Merged
Conversation
… heights, stale devices full width
… over-counting poll events)
- Add .golangci.yml with curated linter set (gosec, misspell, prealloc, gocritic) - Add internal/version package with ldflags-injected Version/Commit/BuildDate - Add unit tests: config (6), retry (4), writers (5) — 15 total - Makefile: ldflags injection, test/version targets, -race flag - Dockerfile: pin Alpine 3.21, build ARGs for version, strip flags - CI: add go test -race step - auth.go: unexport SessionFile, add os.MkdirAll in saveSession - main.go: add signal.Stop(), log version at startup - retry.go: use structured slog args - Pre-commit: add go vet before lint
There was a problem hiding this comment.
Pull request overview
This PR refactors the eero-stats daemon toward a more production-ready v0.2.0 setup: tiered polling with structured writers, build-time version metadata, improved CI/dev tooling, and a regenerated Grafana dashboard.
Changes:
- Implemented tiered polling (fast/medium/slow) with new InfluxDB writer functions and retry logic (+ tests).
- Added build/version metadata plumbing (Go
internal/version, Makefile ldflags, Dockerfile build args) and improved operational boot/shutdown logging. - Replaced the previous Grafana dashboard with a generated “Eero Network Telemetry” dashboard + generator script; updated docs and tooling (CI, golangci-lint config, pre-commit hook).
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
internal/poller/poller.go |
Refactors polling loop into fast/medium/slow tiers with panic-safe wrappers. |
internal/poller/writers.go |
Adds InfluxDB measurements/tags/fields for devices, nodes, network health/config, profiles. |
internal/poller/retry.go + *_test.go |
Adds exponential backoff retry helper with unit tests. |
internal/auth/auth.go |
Improves session caching behavior (mkdir, error handling) and clarifies path handling. |
internal/db/influx.go |
Documents and configures aggressive batching; adds Shutdown API (context parameter). |
scripts/build_dashboard.py |
New dashboard generator producing Grafana JSON with Flux queries and panels. |
grafana/dashboards/eero.json |
New provisioned dashboard JSON (generated). |
grafana/dashboards/eero-overview.json |
Removes old dashboard. |
internal/version/version.go |
Adds build-time version/commit/date variables for ldflags injection. |
cmd/eero-stats/main.go |
Logs version metadata; improves graceful shutdown and Influx shutdown helper. |
README.md |
Updates architecture, setup instructions, and new dashboard positioning. |
Makefile / Dockerfile |
Adds ldflags/versioning, tests target, dashboard target; pins Alpine runtime. |
.github/workflows/ci.yml / .golangci.yml / .githooks/pre-commit |
Tightens CI checks, lint config, and local pre-commit verification. |
.dockerignore |
Adds ignores for local data and env files. |
Comments suppressed due to low confidence (1)
internal/db/influx.go:56
Shutdownaccepts a context and the comment states it can be used for timeout control, but the implementation ignoresctx. Either remove the context parameter/comment, or honorctx(e.g., by running Flush/Close in a goroutine and returning early whenctx.Done()fires).
// Shutdown flushes all buffered writes to disk and closes the InfluxDB
// connection. The provided context can be used for timeout control.
func (i *InfluxClient) Shutdown(ctx context.Context) {
slog.Info("Flushing InfluxDB memory buffers to disk...")
i.WriteAPI.Flush()
i.Client.Close()
slog.Info("InfluxDB connection closed")
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Pin datasource UID in provisioning to match dashboard generator - Rename 'Offline / Stale Devices (>24h)' → 'Currently Disconnected Devices' - Fix README session path from container to host path - Parameterize Grafana admin password via GF_ADMIN_PASSWORD env var - Regenerate dashboard JSON
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updating dashboard to include new stats and displaying onto dashboard