Skip to content

docs(api): deprecate the retired app-control routes, correct the appstats payload - #50

Open
MorningLightMountain713 wants to merge 1 commit into
masterfrom
docs/retire-pause-and-monitoring-routes
Open

docs(api): deprecate the retired app-control routes, correct the appstats payload#50
MorningLightMountain713 wants to merge 1 commit into
masterfrom
docs/retire-pause-and-monitoring-routes

Conversation

@MorningLightMountain713

@MorningLightMountain713 MorningLightMountain713 commented Aug 20, 2026

Copy link
Copy Markdown

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

Endpoint Now In the spec
/apps/apppause in-band 410, use appstop deprecated: true, real error body as the example
/apps/appunpause in-band 410, use appstart same
/apps/startmonitoring in-band 410, no effect same
/apps/stopmonitoring in-band 410, no effect same
/apps/appmonitorstream route deleted — plain 404 documented as 404, points at /apps/appmonitor
/apps/appstats payload narrowed example replaced with the real shape

The 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. appstop does 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 stopmonitoring telling 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 container id and name.

The example now matches what the endpoint returns, field for field. Two consequences are called out in the description: memory_stats.stats carries inactive_file only, and 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 must 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.

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 lint passes with one warning: operation-2xx-response on appmonitorstream, 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.html is rebuilt, since that is what GitHub Pages serves. Same pinned redocly 2.0.8, 34 insertions, no bundler churn.
  • /apps/appmonitor has no entry in this spec at all. It never has. This PR points appmonitorstream callers at it, so it is worth adding — but not inside a deprecation change.

…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>
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.

1 participant