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

Handle query parameter of a scrape #267

Open
beorn7 opened this issue Jan 5, 2017 · 6 comments
Open

Handle query parameter of a scrape #267

beorn7 opened this issue Jan 5, 2017 · 6 comments

Comments

@beorn7
Copy link
Member

beorn7 commented Jan 5, 2017

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

@beorn7 beorn7 added this to the v0.10 milestone Jan 5, 2017
@beorn7 beorn7 self-assigned this Jan 5, 2017
@brian-brazil
Copy link
Contributor

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.

@beorn7
Copy link
Member Author

beorn7 commented Jan 5, 2017

But the blackbox exporter parses query params, and there is no clean way of doing that right now with the client library as is.

@brian-brazil
Copy link
Contributor

There isn't and I don't think there should be. It's too use case specific.

@beorn7
Copy link
Member Author

beorn7 commented Jan 5, 2017

I'll leave this open to vet later.

@beorn7
Copy link
Member Author

beorn7 commented Mar 17, 2021

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).

@beorn7 beorn7 removed their assignment Jun 2, 2021
@beorn7
Copy link
Member Author

beorn7 commented Jun 2, 2021

I mostly assigned this to myself as a “default” because I used to be the maintainer of this repo. Therefore, I'm un-assigning this from myself no. New maintainers @bwplotka & @kakkoyun, please deal with this as you see fit.

@dosubot dosubot bot added the stale label Aug 21, 2024
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

2 participants