feat: Harvest should monitor Arista switches#4313
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class Arista EOS switch monitoring to Harvest by introducing an AristaRest collector (using Arista eAPI JSON-RPC runCmds), along with supporting configuration, docs/metadata generation, and Grafana provisioning/dashboard integration.
Changes:
- Registers and wires a new
AristaRestcollector into poller negotiation/discovery and collector allowlists. - Adds Arista EOS 4.18.5 templates + plugins (version, interfaces, optics, LLDP, environment) with unit tests and fixtures.
- Extends docs, MkDocs nav, Grafana tooling/tests, and MCP metric metadata generation for Arista.
Reviewed changes
Copilot reviewed 51 out of 52 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/conf/collectors.go | Adds AristaRest to collector classification maps. |
| mkdocs.yml | Adds Arista metrics page to site navigation. |
| mcp/metadata/arista_metrics.json | Adds MCP metric description metadata for Arista metrics. |
| grafana/dashboards/arista.yml | Adds Grafana provisioning provider for Arista dashboards. |
| docs/dashboards.md | Updates docs to include Arista as a metrics source. |
| docs/arista-switch-metrics.md | New Arista metrics reference (generated output). |
| conf/aristarest/default.yaml | Default Arista collector schedule and object list. |
| conf/aristarest/eos/4.18.5/environment.yaml | Arista environment template (EOS 4.18.5). |
| conf/aristarest/eos/4.18.5/interface.yaml | Arista interface template (EOS 4.18.5). |
| conf/aristarest/eos/4.18.5/lldp.yaml | Arista LLDP template (EOS 4.18.5). |
| conf/aristarest/eos/4.18.5/optic.yaml | Arista optics template (EOS 4.18.5). |
| conf/aristarest/eos/4.18.5/version.yaml | Arista version/identity template (EOS 4.18.5). |
| cmd/tools/util.go | Adds Arista counter fields + Arista counter doc generator. |
| cmd/tools/grafana/grafana.go | Includes Arista dashboards folder + folder mapping for imports. |
| cmd/tools/grafana/grafana_test.go | Extends Grafana expression checks to Arista dashboards. |
| cmd/tools/grafana/dashboard_test.go | Allows arista tag + includes Arista dashboards in interval checks. |
| cmd/tools/generate/generate.go | Includes Arista dashboards in metrics generation; wires Arista metadata generation. |
| cmd/tools/generate/counter.go | Generates Arista counter docs + Arista MCP metadata file. |
| cmd/tools/generate/arista_counter.yaml | Adds generated counter definition YAML for Arista. |
| cmd/tools/generate/arista_counter.tmpl | Adds template for generating Arista metric documentation. |
| cmd/poller/poller.go | Imports Arista collector; adds Arista negotiation and collector filtering. |
| cmd/collectors/discovery.go | Adds Arista REST discovery/check path. |
| cmd/collectors/arista/arista.go | New Arista collector module + plugin loader. |
| cmd/collectors/arista/rest/client.go | Arista eAPI JSON-RPC client implementation. |
| cmd/collectors/arista/rest/client_test.go | Unit tests for Arista REST client parsing/helpers. |
| cmd/collectors/arista/rest/testdata/show_version.json | Arista REST client test fixture. |
| cmd/collectors/arista/rest/testdata/show_hostname.json | Arista REST client test fixture. |
| cmd/collectors/arista/rest/testdata/show_interfaces_transceiver.json | Arista REST client test fixture. |
| cmd/collectors/arista/rest/testdata/show_lldp_neighbors_detail.json | Arista REST client test fixture. |
| cmd/collectors/arista/rest/testdata/show_env_temperature.json | Arista REST client test fixture. |
| cmd/collectors/arista/rest/testdata/show_env_power.json | Arista REST client test fixture. |
| cmd/collectors/arista/rest/testdata/show_env_cooling.json | Arista REST client test fixture. |
| cmd/collectors/arista/rest/testdata/banner_error.json | Arista REST client test fixture. |
| cmd/collectors/arista/rest/testdata/banner_enable.json | Arista REST client test fixture. |
| cmd/collectors/arista/plugins/version/version.go | Version/labels/uptime plugin for Arista. |
| cmd/collectors/arista/plugins/version/version_test.go | Unit test for Arista version plugin parsing. |
| cmd/collectors/arista/plugins/version/testdata/version.json | Arista version plugin test fixture. |
| cmd/collectors/arista/plugins/optic/optic.go | Optics (DOM) plugin for Arista. |
| cmd/collectors/arista/plugins/optic/optic_test.go | Unit tests for optics parsing (populated/empty). |
| cmd/collectors/arista/plugins/optic/testdata/transceiver.json | Arista optics plugin test fixture. |
| cmd/collectors/arista/plugins/optic/testdata/transceiver_empty.json | Arista optics plugin test fixture. |
| cmd/collectors/arista/plugins/networkinterface/networkinterface.go | Interface counters/admin/link/error-status plugin for Arista. |
| cmd/collectors/arista/plugins/networkinterface/networkinterface_test.go | Unit test for interface parsing and label sanitization. |
| cmd/collectors/arista/plugins/networkinterface/testdata/interfaces.json | Arista interface plugin test fixture. |
| cmd/collectors/arista/plugins/lldp/lldp.go | LLDP neighbor labels plugin for Arista. |
| cmd/collectors/arista/plugins/lldp/lldp_test.go | Unit tests for LLDP parsing and quote trimming. |
| cmd/collectors/arista/plugins/lldp/testdata/lldp.json | Arista LLDP plugin test fixture. |
| cmd/collectors/arista/plugins/environment/environment.go | Environment (temps/fans/PSU) plugin for Arista. |
| cmd/collectors/arista/plugins/environment/environment_test.go | Unit test for environment parsing across sub-responses. |
| cmd/collectors/arista/plugins/environment/testdata/environment.json | Arista environment plugin test fixture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rahulguptajss
previously approved these changes
Jun 8, 2026
| APIs: | ||
| - API: eAPI | ||
| Endpoint: show interfaces | ||
| AristaCounter: interfaceCounters.inErrors |
Contributor
There was a problem hiding this comment.
interfaceCounters.inputErrorsDetail.fcsErrors
|
|
||
| func (e *Environment) parseCooling(output gjson.Result, envMat *matrix.Matrix) { | ||
| if ambient := output.Get("ambientTemperature"); ambient.Exists() { | ||
| instance, err := envMat.NewInstance("cooling_ambient") |
Hardikl
approved these changes
Jun 8, 2026
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.
No description provided.