-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Handle query parameter of a scrape #267
Comments
I strongly believe that cases like the blackbox exporter should be handled by a custom registry, (which wasn't possible in Go at the time that was written). Letting users pass arbitrary blobs down to collectors will only cause problems. Letting users wrap endpoints for auth is an orthogonal problem. |
But the blackbox exporter parses query params, and there is no clean way of doing that right now with the client library as is. |
There isn't and I don't think there should be. It's too use case specific. |
I'll leave this open to vet later. |
Update to current state of the art: Blackbox exporter is solving this with a new custom registry per scrape, see https://github.com/prometheus/blackbox_exporter/blob/master/main.go#L127 . Also, see discussion starting here about passing a context down to collectors. Those could be used to pass down anything (for better or worse), including query parameters. I kind of like how contexts allow those things without any implication they should be used in the regular case (like an explicit function arguments for query parameters would do). |
A prerequisite to #135, this is about the story how to handle scrape query parameter in general.
This should help to implement the blackbox exporter in a cleaner way, cf. https://prometheus.io/docs/instrumenting/writing_exporters/#deployment : “Note that it is only currently possible to write this type of exporter with the Python and Java client libraries (the blackbox exporter which is written in Go is doing the text format by hand, don’t do this).”
It could also help for the mesos exporter use case, see mesos/mesos_exporter#22
The text was updated successfully, but these errors were encountered: