Skip to content

Commit 250c557

Browse files
committed
telemetry: include more detailed server egg and nest usage
1 parent 6272bb6 commit 250c557

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

app/Services/Telemetry/TelemetryCollectionService.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,11 @@ public function collect(): array
116116
'backup' => [
117117
'type' => config('backups.default'),
118118
],
119+
119120
'cache' => [
120121
'type' => config('cache.default'),
121122
],
123+
122124
'database' => [
123125
'type' => config('database.default'),
124126
'version' => DB::getPdo()->getAttribute(PDO::ATTR_SERVER_VERSION),
@@ -139,7 +141,10 @@ public function collect(): array
139141

140142
'eggs' => [
141143
'count' => Egg::count(),
142-
'ids' => Egg::pluck('uuid')->toArray(),
144+
'server_usage' => Egg::all()
145+
->flatMap(fn (Egg $egg) => [$egg->uuid => $egg->servers->count()])
146+
->filter(fn (int $count) => $count > 0)
147+
->toArray(),
143148
],
144149

145150
'locations' => [
@@ -152,6 +157,10 @@ public function collect(): array
152157

153158
'nests' => [
154159
'count' => Nest::count(),
160+
'server_usage' => Nest::all()
161+
->flatMap(fn (Nest $nest) => [$nest->uuid => $nest->eggs->sum(fn (Egg $egg) => $egg->servers->count())])
162+
->filter(fn (int $count) => $count > 0)
163+
->toArray(),
155164
],
156165

157166
'nodes' => [

config/pterodactyl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,6 @@
187187
*/
188188

189189
'telemetry' => [
190-
'enabled' => env('PTERODACTYL_TELEMETRY_ENABLED', false),
190+
'enabled' => env('PTERODACTYL_TELEMETRY_ENABLED', true),
191191
],
192192
];

0 commit comments

Comments
 (0)