diff --git a/src/Prometheus/Storage/Redis.php b/src/Prometheus/Storage/Redis.php index 6e59574a..5627612a 100644 --- a/src/Prometheus/Storage/Redis.php +++ b/src/Prometheus/Storage/Redis.php @@ -150,11 +150,11 @@ private function connectToServer(): void if ($this->options['persistent_connections']) { $connection_successful = $this->redis->pconnect( $this->options['host'], - $this->options['port'], - $this->options['timeout'] + (int) $this->options['port'], + (float) $this->options['timeout'] ); } else { - $connection_successful = $this->redis->connect($this->options['host'], $this->options['port'], $this->options['timeout']); + $connection_successful = $this->redis->connect($this->options['host'], (int) $this->options['port'], (float) $this->options['timeout']); } if (!$connection_successful) { throw new StorageException("Can't connect to Redis server", 0);