cloud_controller_ng icon indicating copy to clipboard operation
cloud_controller_ng copied to clipboard

More direct access to processes states

Open oliveti opened this issue 2 years ago • 1 comments

Context

Creation of a centralised monitoring dashboard of apps based on the api (list of crashed apps).

Issue

With the current existing endpoints, getting "real" state for a list of apps requires too many network calls. As far as I know, the only way to know if an app is crashed is to call the stats endpoints which requires one call per process /v3/processes/process-id/stats.

Current result

When getting an app, the received object only contains the desired state of the app (STARTED, STOPPED). This desired state does not reflect the "real" state of the app processes (we might be crashed).

Possible Fix

A few ideas :

  • Provide an endpoint to get all the stats for all process : v3/stats
  • Include the "real" state (processes states) in the app response.

oliveti avatar Jun 01 '23 07:06 oliveti

AFAIK the /stats endpoint calls the Diego API for information on the apps intances. Its not an information the CC has and is thus costly and seperated into an own endpoint. Have to read this up in code though. Hoever i think one possibility would be to have a /v3/apps/stats endpoint which ahs the same query parameters for the apps as the normal apps listing endpoint. But only if we can then fetch all stats infors from diego in one call also. Needs some investigation but i can understand the use case.

FloThinksPi avatar Sep 08 '23 12:09 FloThinksPi