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

Service discovery is the responsibility of Prometheus #178

Open
brian-brazil opened this issue Mar 26, 2018 · 7 comments
Open

Service discovery is the responsibility of Prometheus #178

brian-brazil opened this issue Mar 26, 2018 · 7 comments

Comments

@brian-brazil
Copy link

https://github.com/siimon/prom-client#default-labels-segmented-by-registry indicates that this library has functionality to allow setting target labels. This is an anti-pattern in Prometheus as that's the role of service discovery/relabelling, and a client library should not facilitate this anti-pattern. This functionality should be removed.

@SimenB
Copy link
Collaborator

SimenB commented Mar 26, 2018

It came from #83 (feature request) and #137 (PR), cc @goofballLogic @nwest1 thoughts?

@nwest1
Copy link
Contributor

nwest1 commented Mar 26, 2018

Thanks for the mention -

Bottom-line, this simplified the code necessary to emit metrics. If it was removed, it would mean more complexity and repetition in our own code, and no (easy) ability to label default metrics in a way we would expect.

Due to timelines/prioritization this was a feature we found useful - especially when not having access to modify prometheus config.

Would a note about the recommended approach be sufficient here without a full removal?

@brian-brazil
Copy link
Author

Would a note about the recommended approach be sufficient here without a full removal?

This is such a common misunderstanding of the Prometheus architecture that it should be removed. You should switch to relabelling for this.

@benny-medflyt
Copy link

I would like to point out that there is a legitimate use case for using prom-client's default labels feature:

When using node cluster node, it can be used to apply a "worker" label with the worker id. This cannot be done outside of prom-client using regular prometheus relabeling.

All of the official prometheus client libraries are for languages that are multi-threaded (rather than multi-process), so they don't need this feature.

@brian-brazil
Copy link
Author

The Python client's multi-process mode handles this internally. Instrumentation shouldn't have to care how exposition is done.

@benny-medflyt
Copy link

The Python client's multi-process mode handles this internally. Instrumentation shouldn't have to care how exposition is done.

I would be happy if prom-client would also handle this internally and automatically 👍

@forresthopkinsa
Copy link

Is there support for the multi-target pattern in this library? It doesn't seem like there's any way to pass parameters into exporters with this client, and that can be a blocker for certain setups

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

No branches or pull requests

5 participants