endclothing / prometheus_client_php

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

Add support for prometheus/pushgateway:>=0.10 #17

Closed kswzr closed 4 years ago

kswzr commented 5 years ago

The prometheus/pushgateway release 0.10. changed the response status code when pushing metrics from 202 to 200 (see: https://github.com/prometheus/pushgateway/releases/tag/v0.10.0).

This fix it and let it downwards compatible for older pushgateway releases. I've also added some tests and added the guzzlehttp/client per injection for easier testing. Additionally I've fixed an issue with wrong type declerations of groupingKeys.

Closes #15 Closes #16