Skip to content

Commit

Permalink
Merge pull request #110 from open-runtimes/feat-image-logging
Browse files Browse the repository at this point in the history
Feat: Runtime image logging
  • Loading branch information
christyjacob4 authored Sep 30, 2024
2 parents ea11112 + 9d320af commit c292a0e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
$table->column('status', Table::TYPE_STRING, 256);
$table->column('key', Table::TYPE_STRING, 1024);
$table->column('listening', Table::TYPE_INT, 1);
$table->column('image', Table::TYPE_STRING, 1024);
$table->create();

return $table;
Expand Down Expand Up @@ -490,6 +491,7 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net

$runtimeHostname = \uniqid();

$log->addTag('image', $image);
$log->addTag('version', $version);
$log->addTag('runtimeId', $runtimeName);

Expand All @@ -515,6 +517,7 @@ function cleanUp(Orchestration $orchestration, Table $activeRuntimes, array $net
'updated' => $startTime,
'status' => 'pending',
'key' => $secret,
'image' => $image,
]);

/**
Expand Down Expand Up @@ -880,6 +883,7 @@ function (string $runtimeId, ?string $payload, string $path, string $method, mix

$runtimeName = System::getHostname() . '-' . $runtimeId;

$log->addTag('image', $image);
$log->addTag('version', $version);
$log->addTag('runtimeId', $runtimeName);

Expand Down Expand Up @@ -982,6 +986,9 @@ function (string $runtimeId, ?string $payload, string $path, string $method, mix

// Update swoole table
$runtime = $activeRuntimes->get($runtimeName) ?? [];

$log->addTag('image', $runtime['image']);

$runtime['updated'] = \time();
$activeRuntimes->set($runtimeName, $runtime);

Expand Down

0 comments on commit c292a0e

Please sign in to comment.