feat: implement DumpState for file-discovery#1836
Open
thc1006 wants to merge 1 commit into
Open
Conversation
shmuelk
reviewed
Jun 28, 2026
| Endpoints []string `json:"endpoints"` | ||
| TotalEndpoints int `json:"totalEndpoints"` | ||
| MaxEndpoints int `json:"maxEndpoints"` | ||
| Truncated bool `json:"truncated"` |
Contributor
There was a problem hiding this comment.
Why is the field Truncated needed. A quick manual comparison of TotalEndpoints and MaxEndpoints will tell a user whether or not the output was truncated.
Author
There was a problem hiding this comment.
Right, totalEndpoints > maxEndpoints carries the same information, so I've removed the field and noted the derivation on the struct. The cap stays so the dump is still bounded.
Expose the set of endpoints currently loaded from the discovery file through /debug/plugins/state. Only the endpoint identities are reported, sorted and capped so the payload stays bounded; addresses and labels are left out. DumpState reads the endpoint set concurrently with file reloads, so a read-write mutex now guards it and load swaps the set under the lock. Part of llm-d#1755. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
cf5dbda to
a57b409
Compare
shmuelk
approved these changes
Jun 29, 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.
What type of PR is this?
/kind feature
What this PR does / why we need it:
Adds
plugin.StateDumperto the file-discovery plugin so the endpoints itcurrently has loaded can be inspected through
GET /debug/plugins/state, thesame way the
inflight-load-produceralready exposes its state.DumpStatereports the endpoint identities (namespace/name) only, sorted andcapped at 100 with a
truncatedflag so the payload stays bounded. Addressesand labels are deliberately left out.
The endpoint set is read concurrently with file reloads, so this adds a
read-write mutex to guard it;
loadnow swaps the set under the lock. Behaviouris otherwise unchanged.
Example response for this plugin:
{"endpoints":["default/pod-a","default/pod-b"],"totalEndpoints":2,"maxEndpoints":100,"truncated":false}Part of #1755.
Which issue(s) this PR fixes:
Fixes #1776
Release note (write
NONEif no user-facing change):Testing:
New unit tests, all passing (race detector enabled):