docs(api): deprecate the retired app-control routes, correct the appstats payload - #50
Open
MorningLightMountain713 wants to merge 1 commit into
Open
Conversation
…t the appstats payload Five endpoints changed in FluxOS and the spec still documents the old behaviour. This is the contract third parties build against, so it is wrong on the day the release lands. /apps/apppause and /apps/appunpause are removed. Docker reports a paused container as running, so a paused app stayed listed as healthy: the load balancer kept routing to a server whose processes were frozen and could never answer, and monitoring showed a flat line with no explanation. Nothing could release one either. appstop/appstart replace them. /apps/startmonitoring and /apps/stopmonitoring are removed. The node monitors every app it runs, for the CPU throttling loop, so there was nothing for a caller to turn on or off - and one told "success" by stopmonitoring would have believed monitoring had stopped while it was still running. All four still answer, in band at HTTP 200 with code 410, so an existing caller learns why rather than failing blind. They are marked deprecated with the real error body as the example rather than deleted, because a caller looking the endpoint up should find the explanation. /apps/appmonitorstream is the one that is genuinely gone - the route no longer exists, so it returns a plain 404. Documented as such, and pointed at /apps/appmonitor. That trips redocly's operation-2xx-response warning, which is accurate: the endpoint cannot return a 2xx any more, and documenting one that cannot happen would be worse than the warning. /apps/appstats published the FULL raw dockerode object as its example. The node now keeps only the values a consumer reads and drops the rest before it reaches the wire, so that example advertised eleven fields that no longer exist: percpu_usage, usage_in_kernelmode, usage_in_usermode, throttling_data, max_usage, failcnt, pids_stats, num_procs, storage_stats, preread, read, and the container id and name. Replaced with the shape the endpoint actually returns, and the description now names what was dropped - including that percpu_usage is gone, so a consumer using docker's documented "fall back to the length of percpu_usage when online_cpus is 0" trick has to read online_cpus directly. disk_stats is documented properly while here: status is success, partial or error, and a partial reading is a floor rather than a total - charting one as a real value shows a drop that did not happen. docs/index.html rebuilt with the same redocly 2.0.8 the lockfile pins, since the built site is what GitHub Pages serves. NOTE: /apps/appmonitor, which this now points callers at, has no entry in this spec at all. Worth adding, but not in a deprecation change. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Five endpoints changed in FluxOS. This spec is the contract third parties build against, so it is wrong on the day the release lands.
What changed
/apps/apppauseappstopdeprecated: true, real error body as the example/apps/appunpauseappstart/apps/startmonitoring/apps/stopmonitoring/apps/appmonitorstream/apps/appmonitor/apps/appstatsThe four in-band ones are marked deprecated rather than deleted, because they still answer and a caller looking one up should find the explanation rather than silence.
Why pause went
Docker reports a paused container as running. A paused app stayed listed as healthy: the load balancer kept routing to a server whose processes were frozen and could never answer, monitoring showed a flat line with no explanation, and nothing could release it.
appstopdoes the same job, is visible everywhere as stopped, and can always be started again.Monitoring is not optional — the node monitors every app it runs for CPU throttling — so
stopmonitoringtelling a caller "success" meant believing monitoring had stopped while it was still running.The appstats example was publishing fields we no longer return
It carried the full raw dockerode object. Thirteen of those fields are now dropped before the response reaches the wire:
percpu_usage,usage_in_kernelmode,usage_in_usermode,throttling_data,max_usage,failcnt,pids_stats,num_procs,storage_stats,preread,read, and the containeridandname.The example now matches what the endpoint returns, field for field. Two consequences are called out in the description:
memory_stats.statscarriesinactive_fileonly, andpercpu_usageis gone — so a consumer using docker's documented "fall back to the length of percpu_usage when online_cpus is 0" trick must readonline_cpusdirectly.disk_statsis documented properly while here:statusissuccess,partialorerror, and apartialreading is a floor rather than a total — charting one as a real value shows a drop that did not happen.Merge dependency
Depends on
RunOnFlux/flux#1777. This spec describes behaviour that only exists once that ships. Merging earlier documents endpoints as removed while they still work.The customer-facing half is RunOnFlux/flux-docs#16, which rewrites the six game world-upload guides that tell people to use Pause.
Notes for review
redocly lintpasses with one warning:operation-2xx-responseonappmonitorstream, which is accurate — that route cannot return a 2xx any more, and documenting one that cannot happen would be worse than the warning.docs/index.htmlis rebuilt, since that is what GitHub Pages serves. Same pinned redocly 2.0.8, 34 insertions, no bundler churn./apps/appmonitorhas no entry in this spec at all. It never has. This PR pointsappmonitorstreamcallers at it, so it is worth adding — but not inside a deprecation change.