fix: force LC_ALL=C for metric commands to avoid comma decimal separator
Some locales use comma as decimal separator (e.g., es_DO.UTF-8). This caused invalid JSON like "cpu": 2,4 instead of "cpu": 2.4. Prefixed CPU and RAM commands with LC_ALL=C to force dot decimals. Also removed debug logging from pushMetrics endpoint.
This commit is contained in:
@@ -303,14 +303,6 @@ class ApiController
|
||||
$rawBody = file_get_contents('php://input');
|
||||
$input = json_decode($rawBody, true);
|
||||
|
||||
$logger = \ServerManager\Core\Logger::getInstance();
|
||||
$logger->warning('Push metrics received', [
|
||||
'input_keys' => $input ? array_keys($input) : [],
|
||||
'has_agent_key' => !empty($input['agent_key']),
|
||||
'agent_key_prefix' => isset($input['agent_key']) ? substr((string)$input['agent_key'], 0, 8) . '...' : 'none',
|
||||
'raw_body_prefix' => substr($rawBody, 0, 200),
|
||||
]);
|
||||
|
||||
if (!$input || empty($input['agent_key'])) {
|
||||
$this->view->json(['error' => 'agent_key is required'], 401);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user