Jimdo / prometheus_client_php

Prometheus instrumentation library for PHP applications
https://prometheus.io/docs/concepts/metric_types/
Apache License 2.0
281 stars 213 forks source link

Fix pushgateway delete method #82

Open lvrach opened 6 years ago

lvrach commented 6 years ago

I got the following error when calling $pushgateway->delete(...):

Argument 1 passed to Prometheus\PushGateway::doRequest() must be an instance of Prometheus\CollectorRegistry, null given, called in /.../vendor/jimdo/prometheus_client_php/src/Prometheus/PushGateway.php on line 54
#0 /.../vendor/jimdo/prometheus_client_php/src/Prometheus/PushGateway.php(54): Prometheus\PushGateway->doRequest(NULL, 'resque-php', Array, 'delete') 
...

Because delete method was calling doRequest with null $collectorRegistry, but the method definition did not permit it.

I simple change doRequest to accept null $collectorRegistry.

jlis commented 6 years ago

Also fixed in #81. But still not merged.

NoelDavies commented 5 years ago

This project is dead, but I'm maintaining it under my employer - https://github.com/endclothing/prometheus_client_php. Feel free to submit the PR there.