refactor: update container name assignment in Application model

This commit is contained in:
Andras Bacsai 2024-06-20 13:30:17 +02:00
parent c81ad5cd03
commit 6493ce3fe0

View File

@ -1171,7 +1171,7 @@ public function generate_preview_fqdn(int $pull_request_id)
public function getMetrics(int $mins = 5)
{
$server = $this->destination->server;
$container_name = generateApplicationContainerName($this);
$container_name = $this->uuid;
if ($server->isMetricsEnabled()) {
$from = now()->subMinutes($mins)->toIso8601ZuluString();
$metrics = instant_remote_process(["docker exec coolify-sentinel sh -c 'curl -H \"Authorization: Bearer {$server->settings->metrics_token}\" http://localhost:8888/api/container/{$container_name}/metrics/history?from=$from'"], $server, false);