Skip to content

Commit 95e834a

Browse files
committed
feat: #207 ingest only eth network interfaces metrics
1 parent 2724255 commit 95e834a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: api-nodes/Http/Controllers/MetricsController.php

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Http\Request;
1010
use Illuminate\Http\Response;
1111
use Illuminate\Log\Logger;
12+
use Illuminate\Support\Str;
1213

1314
class MetricsController
1415
{
@@ -46,7 +47,10 @@ class MetricsController
4647
public function __invoke(Request $request, Logger $log, Node $node)
4748
{
4849
// TODO: cache this with the new Laravel cache system (stale-while-revalidate from the recent release)
49-
$interfaces = collect($node->data->host->networks)->pluck('if_name')->unique()->toArray();
50+
$interfaces = collect($node->data->host->networks)->pluck('if_name')->filter(function ($interface) {
51+
// Collect only the interfaces that start with 'eth' for now
52+
return Str::startsWith($interface, 'eth');
53+
})->unique()->toArray();
5054

5155
$services = $node->team->services->mapWithKeys(function ($service) {
5256
$processes = collect($service->latestDeployment->data->processes);

0 commit comments

Comments
 (0)