Skip to content

Add gateway replica events - #4212

Merged
jvstme merged 1 commit into
masterfrom
issue_3959_gateway_replica_events
Aug 26, 2026
Merged

Add gateway replica events#4212
jvstme merged 1 commit into
masterfrom
issue_3959_gateway_replica_events

Conversation

@jvstme

@jvstme jvstme commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator
  • Add the gateway-replica event target type.
  • Add the target_gateway_replicas and within_gateways filters to /api/events/list.
  • Add the new target type and filters to UI.
  • Add the --within-gateway filter to the dstack event list CLI command (target_replicas, however, does not have a counterpart in the CLI, consistent with target_jobs and target_instances).
  • Add event coverage for the gateway replica lifecycle: creation, status changes, service and service replica registration and unregistration.
$ dstack event --within-gateway my-gateway
[2026-08-25 22:56:11] [👤admin] [gateway my-gateway] Gateway created. Status: SUBMITTED
[2026-08-25 22:56:14] [gateway my-gateway] Gateway status changed SUBMITTED -> PROVISIONING
[2026-08-25 22:56:14] [gateway-replica my-gateway-0] Gateway replica created. Status: SUBMITTED
[2026-08-25 22:56:14] [gateway-replica my-gateway-1] Gateway replica created. Status: SUBMITTED
[2026-08-25 22:56:38] [gateway-replica my-gateway-0] Gateway replica status changed SUBMITTED -> PROVISIONING
[2026-08-25 22:56:38] [gateway-replica my-gateway-1] Gateway replica status changed SUBMITTED -> PROVISIONING
[2026-08-25 22:57:52] [gateway-replica my-gateway-1] Gateway replica status changed PROVISIONING -> RUNNING
[2026-08-25 22:57:58] [gateway-replica my-gateway-0] Gateway replica status changed PROVISIONING -> RUNNING
[2026-08-25 22:58:06] [gateway my-gateway] Gateway status changed PROVISIONING -> RUNNING
[2026-08-25 22:58:25] [run my-service, gateway my-gateway] Service assigned to gateway
[2026-08-25 22:58:26] [run my-service, gateway-replica my-gateway-1] Service registered
[2026-08-25 22:58:28] [run my-service, gateway-replica my-gateway-0] Service registered
[2026-08-25 23:01:33] [job my-service-0-0, gateway-replica my-gateway-1] Service replica registered
[2026-08-25 23:01:33] [job my-service-0-0, gateway-replica my-gateway-0] Service replica registered
[2026-08-25 23:02:32] [👤admin] [gateway my-gateway] Gateway updated. Changed fields: replicas
[2026-08-25 23:02:42] [gateway-replica my-gateway-0] Gateway replica status changed RUNNING -> TERMINATING (Scaled in)
[2026-08-25 23:02:58] [gateway-replica my-gateway-0] Gateway replica status changed TERMINATING -> TERMINATED

#3959

- Add the `gateway-replica` event target type.
- Add the `target_gateway_replicas` and
  `within_gateways` filters to `/api/events/list`.
- Add the new target type and filters to UI.
- Add the `--within-gateway` filter to the
  `dstack event list` CLI command
  (`target_replicas`, however, does not have a
  counterpart in the CLI, consistent with
  `target_jobs` and `target_instances`).
- Add event coverage for the gateway replica
  lifecycle: creation, status changes, service and
  service replica registration and unregistration.

```shell
$ dstack event --within-gateway my-gateway
[2026-08-25 22:56:11] [👤admin] [gateway my-gateway] Gateway created. Status: SUBMITTED
[2026-08-25 22:56:14] [gateway my-gateway] Gateway status changed SUBMITTED -> PROVISIONING
[2026-08-25 22:56:14] [gateway-replica my-gateway-0] Gateway replica created. Status: SUBMITTED
[2026-08-25 22:56:14] [gateway-replica my-gateway-1] Gateway replica created. Status: SUBMITTED
[2026-08-25 22:56:38] [gateway-replica my-gateway-0] Gateway replica status changed SUBMITTED -> PROVISIONING
[2026-08-25 22:56:38] [gateway-replica my-gateway-1] Gateway replica status changed SUBMITTED -> PROVISIONING
[2026-08-25 22:57:52] [gateway-replica my-gateway-1] Gateway replica status changed PROVISIONING -> RUNNING
[2026-08-25 22:57:58] [gateway-replica my-gateway-0] Gateway replica status changed PROVISIONING -> RUNNING
[2026-08-25 22:58:06] [gateway my-gateway] Gateway status changed PROVISIONING -> RUNNING
[2026-08-25 22:58:25] [run my-service, gateway my-gateway] Service assigned to gateway
[2026-08-25 22:58:26] [run my-service, gateway-replica my-gateway-1] Service registered
[2026-08-25 22:58:28] [run my-service, gateway-replica my-gateway-0] Service registered
[2026-08-25 23:01:33] [job my-service-0-0, gateway-replica my-gateway-1] Service replica registered
[2026-08-25 23:01:33] [job my-service-0-0, gateway-replica my-gateway-0] Service replica registered
[2026-08-25 23:02:32] [👤admin] [gateway my-gateway] Gateway updated. Changed fields: replicas
[2026-08-25 23:02:42] [gateway-replica my-gateway-0] Gateway replica status changed RUNNING -> TERMINATING (Scaled in)
[2026-08-25 23:02:58] [gateway-replica my-gateway-0] Gateway replica status changed TERMINATING -> TERMINATED
```
@jvstme
jvstme merged commit 363ab03 into master Aug 26, 2026
27 checks passed
@jvstme
jvstme deleted the issue_3959_gateway_replica_events branch August 26, 2026 07:54
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