Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion library/Perfdatagraphsprometheus/Client/Prometheus.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Prometheus
protected const QUERYRANGE_ENDPOINT = '/api/v1/query_range';

/** @var $this \Icinga\Application\Modules\Module */
protected $client = null;
protected Client $client;

protected string $URL;
protected int $maxDataPoints;
Expand Down
10 changes: 3 additions & 7 deletions library/Perfdatagraphsprometheus/Client/Transformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,10 @@ class Transformer
* output format we need.
*
* @param GuzzleHttp\Psr7\Response $response the data to transform
* @param array $includeMetrics metrics to include in the response
* @param array $excludeMetrics metrics to exlude from the response
* @return PerfdataResponse
*/
public static function transform(
Response $response,
array $excludeMetrics = [],
): PerfdataResponse {
public static function transform(Response $response): PerfdataResponse
{
$pfr = new PerfdataResponse();

if (empty($response)) {
Expand All @@ -40,7 +36,7 @@ public static function transform(
$body = json_decode($response->getBody()->getContents(), true);

if ($body['status'] !== 'success') {
$perfdataresponse->addError($body['error'] ?? 'unknown error');
$pfr->addError($body['error'] ?? 'unknown error');
return $pfr;
}

Expand Down