@@ -50,7 +50,7 @@ public static function snapshot(?CarbonInterface $now = null, ?string $namespace
5050 'command_contracts ' => self ::commandContractMetrics ($ namespace ),
5151 'projections ' => self ::projectionMetrics ($ now , $ namespace ),
5252 'schedules ' => self ::scheduleMetrics ($ now , $ namespace ),
53- 'workers ' => self ::workerMetrics (),
53+ 'workers ' => self ::workerMetrics ($ namespace ),
5454 'backend ' => BackendCapabilities::snapshot ($ now ),
5555 'structural_limits ' => StructuralLimits::snapshot (),
5656 'update_wait ' => UpdateWaitPolicy::snapshot (),
@@ -302,10 +302,13 @@ private static function scheduleMetrics(CarbonInterface $now, ?string $namespace
302302 /**
303303 * @return array<string, mixed>
304304 */
305- private static function workerMetrics (): array
305+ private static function workerMetrics (? string $ namespace ): array
306306 {
307307 $ required = WorkerCompatibility::current ();
308- $ snapshots = WorkerCompatibilityFleet::details ($ required );
308+ $ compatibilityNamespace = $ namespace ?? WorkerCompatibilityFleet::scopeNamespace ();
309+ $ snapshots = $ compatibilityNamespace === null
310+ ? WorkerCompatibilityFleet::details ($ required )
311+ : WorkerCompatibilityFleet::detailsForNamespace ($ compatibilityNamespace , $ required );
309312 $ workerIds = [];
310313 $ supportingWorkerIds = [];
311314 $ fleet = [];
@@ -329,7 +332,7 @@ private static function workerMetrics(): array
329332 }
330333
331334 return [
332- 'compatibility_namespace ' => WorkerCompatibilityFleet:: scopeNamespace () ,
335+ 'compatibility_namespace ' => $ compatibilityNamespace ,
333336 'required_compatibility ' => $ required ,
334337 'active_workers ' => count ($ workerIds ),
335338 'active_worker_scopes ' => count ($ snapshots ),
0 commit comments