Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Implements controller-side RPC diagnostics export for Prometheus by introducing a new GetDiag API call and wiring its data into the metrics collector.
- Adds
GetDiagto the Slurm API interface, client implementation, and mock. - Defines and registers four RPC-related counters and one gauge for server threads.
- Extends unit tests to verify RPC metrics output and edge‐case handling.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/slurmapi/interface.go | Added GetDiag to the Client interface |
| internal/slurmapi/fake/mock_client.go | Implemented mock methods for GetDiag |
| internal/slurmapi/client.go | Implemented GetDiag using SlurmV0041GetDiagWithResponse and error checks |
| internal/exporter/collector.go | Defined RPC and thread‐count metric descriptors and wired them into Collect |
| internal/exporter/collector_test.go | Extended tests to assert presence/absence of new metrics |
Comments suppressed due to low confidence (1)
internal/exporter/collector_test.go:11
- You’ve imported the same package twice under two names (
apiandslurmapispec), which will cause a compile error. Remove the redundant import alias.
slurmapispec "github.com/SlinkyProject/slurm-client/api/v0041"
70e7ffa to
1ac8c95
Compare
Export SLURM controller diagnostics as Prometheus metrics including: - RPC calls and duration by message type - RPC calls and duration by user - Controller server thread count
1ac8c95 to
6a684bb
Compare
rdjjke
approved these changes
Jun 24, 2025
Uburro
approved these changes
Jun 24, 2025
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.
Summary
Implements SLURM controller RPC metrics export functionality for monitoring controller performance.
Changes
slurm_controller_rpc_calls_totalandslurm_controller_rpc_duration_seconds_totalmetrics withmessage_typelabelsslurm_controller_rpc_user_calls_totalandslurm_controller_rpc_user_duration_seconds_totalmetrics withuseranduser_idlabelsslurm_controller_server_thread_countgauge metricNew Metrics Output
Resolves #1027