Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add :labels for Prometheus::Middleware::Collector #180

Closed
wants to merge 3 commits into from

Conversation

benyitzhaki
Copy link

This pull request makes it possible to pass a labels argument that will add default labels to each metric exposed using the collector middleware.
Usage example:
config.middleware.use Prometheus::Middleware::Collector, { labels: { env: Rails.env } }

Signed-off-by: Ben Yitzhaki <beny@monday.com>
@coveralls
Copy link

coveralls commented Feb 6, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling c9e0f6e on benyitzhaki:master into 4f8de6c on prometheus:master.

Signed-off-by: Ben Yitzhaki <beny@monday.com>
Signed-off-by: Ben Yitzhaki <beny@monday.com>
@benyitzhaki benyitzhaki changed the title add support for custom labels for the collector middleware add support for custom labels to the collector middleware Feb 6, 2020
@benyitzhaki benyitzhaki requested review from Sinjo and dmagliola and removed request for Sinjo February 6, 2020 14:43
@benyitzhaki benyitzhaki changed the title add support for custom labels to the collector middleware Add :labels for Prometheus::Middleware::Collector Feb 6, 2020
@brian-brazil
Copy link

brian-brazil commented Feb 6, 2020 via email

@Sinjo
Copy link
Member

Sinjo commented Feb 6, 2020

Hi @benyitzhaki,

First off, thanks for taking time to send us a PR.

I agree with @brian-brazil on this one. What's worth mentioning is that we did have a more flexible version of this that we removed pre-1.0. The reason we removed it wasn't that we disliked the feature, but that we felt the API was confusing. We would potentially be open to bringing that version back if the concerns in #111 were addressed.

I'm going to close this PR, but we'd be happy to hear suggestions on a more intuitive API for the version we removed in #121.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants