Skip to content

Split collectors into sub-collectors, test each collector, support new resources - #14

Merged
MurrayGroves merged 33 commits into
mainfrom
testing
Oct 29, 2026
Merged

MurrayGroves merged 33 commits into
mainfrom
testing

Conversation

@MurrayGroves

@MurrayGroves MurrayGroves commented Oct 28, 2026 •

Copy link
Copy Markdown

Splits all the collectors out into a hierarchy of sub-collectors to reflect the hierarchy in Redfish and to allow for better parallelisation of collection.

Generally tidies up all collectors, and ensures proper use of waitgroups and spawning of goroutines (e.g. system collector called sub-collectors sequentially).

Adds testing for all metrics. Tests spin up a Docker container serving the specified Redfish mockup, and the Prometheus output produced by the exporter is compared against correct values. From project root, tests can be run with FIXTURES_DIR="$(pwd)/test_dependencies" go test ./....

Allows multiple HTTP requests to be in-flight at once (currently fixed at 1024, but will be specifiable in config in future PR).
Also allows re-use of TCP connections between requests (connections time out after one minute of inactivity).

Added support for the new Ports resource, since NetworkPorts was deprecated in Redfish v1.5.0

Added support for getting power metrics from the new PowerSubsystem resource, since Power was deprecated in redfish v1.15.0. Note that voltage readings and power control data are unavailable with the new PowerSubsystem until a future PR where support for the new EnvironmentMetrics and Sensor resources is added.

Added support for getting thermal metrics from the new ThermalSubsystem resource, since Thermal was deprecated in redfish v1.15.0. Note that fan RPM readings are unavailable with ThermalSubsystem due to an upstream bug (stmcginnis/gofish#585).

Tested against 2026.2 with a chassis with no link status, and one with link status.
The pedantic registry performs metadata validation at collector
registration instead of at collection time. Also enforces that only
described metrics are sent.
In order to allow deserialisation of Power data from uncompliant BMCs
which send PowerLimit.LimitInWatts as a string not a float64.
@MurrayGroves
MurrayGroves force-pushed the testing branch 2 times, most recently from 08222a2 to 529d787 Compare October 28, 2026 16:47
@MurrayGroves
MurrayGroves marked this pull request as ready for review October 28, 2026 16:55
@MurrayGroves
MurrayGroves added this pull request to stack #16 October 29, 2026 12:31

@dougszumski dougszumski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @MurrayGroves it looks great.

Please could you add support to the Makefile to run the tests and get pull_request.yml to use it via make test. It would save having to worry about setting the FIXTURES_DIR. It was easy to get going locally, good stuff.

The core looks good to me though. I haven't checked all the test data, it almost crashed the browser :D

Comment thread common/context.go Resolved
Comment thread main.go Resolved

@dougszumski dougszumski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @MurrayGroves it looks great.

Please could you add support to the Makefile to run the tests and get pull_request.yml to use it via make test. It would save having to worry about setting the FIXTURES_DIR. It was easy to get going locally, good stuff.

The core looks good to me though. I haven't checked all the test data, it almost crashed the browser :D

@MurrayGroves

Copy link
Copy Markdown
Author

@dougszumski added makefile testing

Comment thread Makefile Resolved
@MurrayGroves
MurrayGroves merged commit 3be89ef into main Oct 29, 2026
1 check passed
@MurrayGroves
MurrayGroves deleted the testing branch October 30, 2026 10:17
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.

2 participants