PromPHP / prometheus_client_php

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

Enable usage of metrics with same name but different labels #61

Closed grota closed 2 years ago

grota commented 3 years ago

Hi there, this PR enables the user of this client lib to use different labels (names and values) for metrics.

grota commented 3 years ago

can anyone review this? or at least start the checks?

LKaemmerling commented 2 years ago

Hey @grota,

Sore for the late answer, i had a lot to do!

I’m not sure if this is the correct behavior. If I see it correctly none of the official libraries supports this.

grota commented 2 years ago

Hi @LKaemmerling ok sorry for the pressure. I see your point, I tested out a python client library and indeed it does not permit this behavior. It's kinda strange because I'm testing a fork that does allow it and the prometheus backend does not complain. But I understand the situation and I'm going to close this PR.

As a follow up question, would you be willing to accept a PR where we substitute private to protected in the InMemory storage? We are developing a drupal module which is implementing a drupal cache based storage adapter which is leveraging/extending the InMemory class (the 4 class fields and metaKey()). For the moment I had to resort to copying the class.

See for reference

LKaemmerling commented 2 years ago

Hi @LKaemmerling ok sorry for the pressure.

I see your point, I tested out a python client library and indeed it does not permit this behavior.

It's kinda strange because I'm testing a fork that does allow it and the prometheus backend does not complain.

But I understand the situation and I'm going to close this PR.

As a follow up question, would you be willing to accept a PR where we substitute private to protected in the InMemory storage?

We are developing a drupal module which is implementing a drupal cache based storage adapter which is leveraging/extending the InMemory class (the 4 class fields and metaKey()).

For the moment I had to resort to copying the class.

See for reference

Hey @grota,

Would be fine for me :)