prometheus_exporter icon indicating copy to clipboard operation
prometheus_exporter copied to clipboard

Add hostname to puma instrumentation

Open codez opened this issue 4 years ago • 5 comments

Other than e.g. the process instrumentation, the puma metrics do not include a hostname. In our setup, multiple puma containers report towards the same prometheus exporter. Without the hostname, they overwrite each others values.

There is also no option to add custom labels to the puma instrumentation either. This would have allowed us to add a hostname label on our own.

I am willing to work on a pull request for this. Which option do you prefer, always adding a hostname label, add custom labels or both?

codez avatar Jun 17 '21 09:06 codez

I think it makes sense to add unconditionally

On Thu, 17 Jun 2021 at 7:37 pm, z @.***> wrote:

Other than e.g. the process instrumentation, the puma metrics do not include a hostname. In our setup, multiple puma containers report towards the same prometheus exporter. Without the hostname, they overwrite each others values.

There is also no option to add custom labels to the puma instrumentation either. This would have allowed us to add a hostname label on our own.

I am willing to work on a pull request for this. Which option do you prefer, always adding a hostname label, add custom labels or both?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/discourse/prometheus_exporter/issues/172, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAABIXK6M74UNLJHNLCEEQTTTG67FANCNFSM463I3XXQ .

SamSaffron avatar Jun 18 '21 07:06 SamSaffron

Oops, I'm sorry I don't quite understand your answer as a non-native English speaker. Do you think it's best to add both an option for custom labels and the hostname unconditionally?

By the way, I saw that while other instrumentations add the hostname, it is not propagated by the server but only used to distinguish different values. This should not be needed for the puma metrics IMHO.

codez avatar Jun 20 '21 14:06 codez

Sorry, I was way too short there. :pensive:

I think it is fine to add hostname label for Puma unconditionally in a PR

I am also not against adding support for custom label support in puma in a different PR.

SamSaffron avatar Jun 20 '21 23:06 SamSaffron

That's ok, I will try to start work on it in the next couple of days.

codez avatar Jun 21 '21 06:06 codez

Hi there, Any plans to release this? I really need it. Thanks

bgmat avatar Jan 25 '22 09:01 bgmat