Skip to content

Conversation

@philippthun
Copy link
Member

@philippthun philippthun commented Jan 21, 2026

Implement GET /v3/processes/:guid/process_instances

This endpoint returns information for all process instances (= actual LRPs) for the given process. Per process instance the following information is shown: index, state, since.

The data is retrieved from Diego via the endpoint /v1/actual_lrps/list_by_process_guids.

The InstancesStatsReporter processes this data as follows:

  • group by process guid
  • sort / group by index
  • keep only the newest LRP per index
  • fill missing instances (i.e. less actual LRPs than desired) with DOWN state

Additional changes:

  • BbsInstancesClient: handle_diego_errors needs check for ResourceNotFound only when calling desired_lrp_by_process_guid. The other methods return an empty list.
  • BuildpackPresenter, ProcessPresenter: remove useless method

Implement embed=process_instances

Process instances can be embedded into process resources; the parameter embed=process_instances is available for the following API endpoints:

  • GET /v3/processes/:guid?embed=process_instances
  • GET /v3/apps/:guid/processes/:type?embed=process_instances
  • GET /v3/processes?embed=process_instances
  • GET /v3/apps/:guid/processes?embed=process_instances

A new ProcessShowMessage has been introduced; ProcessesListMessage has been extended. Both messages allow the embed key that is checked with the EmbedParamValidator.

The process output is enhanced by the EmbedProcessInstancesDecorator that fetches the required information from Diego and adds a field process_instances to the resource.

Process resources now also contain a link to process_instances.

API docs have been extended with the new process instances pseudo-resource and a description of the embed parameter.

Fixes #3594.

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@philippthun philippthun force-pushed the process-instances branch 2 times, most recently from a4969fb to 91e85dc Compare January 30, 2026 16:10
@philippthun philippthun changed the title Implement GET /v3/processes/:guid/instances Implement GET /v3/processes/:guid/instances and embed=process_instances Jan 30, 2026
This endpoint returns information for all process instances (= actual
LRPs) for the given process. Per process instance the following
information is shown: index, state, since.

The data is retrieved from Diego via the endpoint
'/v1/actual_lrps/list_by_process_guids'.

The InstancesStatsReporter processes this data as follows:
- group by process guid
- sort / group by index
- keep only the newest LRP per index
- fill missing instances (i.e. less actual LRPs than desired) with DOWN
  state

Additional changes:
- BbsInstancesClient: handle_diego_errors needs check for
  ResourceNotFound only when calling desired_lrp_by_process_guid. The
  other methods return an empty list.
- BuildpackPresenter, ProcessPresenter: remove useless method

Co-authored-by: Sven Krieger <sven.krieger@sap.com>
@philippthun philippthun changed the title Implement GET /v3/processes/:guid/instances and embed=process_instances Implement GET /v3/processes/:guid/process_instances and embed=process_instances Feb 3, 2026
@philippthun philippthun marked this pull request as ready for review February 3, 2026 13:02
Process instances can be embedded into process resources; the parameter
embed=process_instances is available for the following API endpoints:
- GET /v3/processes/:guid?embed=process_instances
- GET /v3/apps/:guid/processes/:type?embed=process_instances
- GET /v3/processes?embed=process_instances
- GET /v3/apps/:guid/processes?embed=process_instances

A new ProcessShowMessage has been introduced; ProcessesListMessage has
been extended. Both messages allow the 'embed' key that is checked with
the EmbedParamValidator.

The process output is enhanced by the EmbedProcessInstancesDecorator
that fetches the required information from Diego and adds a field
'process_instances' to the resource.

Process resources now also contain a link to 'process_instances'.

API docs have been extended with the new process instances
pseudo-resource and a description of the 'embed' parameter.

The 'embed' parameter is also described in the V3 style guide.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bulk API for process stats

1 participant