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

Support AMQP as a medium for scraping (apart from http{s}). #1691

Closed
mishas opened this Issue May 30, 2016 · 7 comments

Comments

Projects
None yet
4 participants
@mishas
Copy link

mishas commented May 30, 2016

Many distributed systems already have one control/management channel opened into the network, and opening another one (for example http{s} for scraping) may raise security or otherwise maintenance concerns.

One protocol that is extremely popular in this space is the AMQP protocol (RabbitMQ).
AMQP protocol supports the RPC use case, which can be easily used by prometheus to scrape the information needed.

My feature request is to implement such scraping mechanism.

Please note, that for now, I've implemented a "proxy" service that accepts HTTP{s} requests and sends an AMQP-RPC request to my remote servers, but this is very patchy and I'd prefer this to be integrated into Prometheus. Code can be found here.

I also volunteer to implement this in prometheus code base (and send a pull request), if it's something you see fit in the project.

@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented May 30, 2016

A system where there's no HTTP and where it cannot be added at all sounds like a very niche use case. I don't think it would be appropriate to add an additional non-HTTP scrape protocol to support it.

@mishas

This comment has been minimized.

Copy link
Author

mishas commented May 30, 2016

I don't think it's that niche. As mentioned on the "Pushing metrics" page, they may just live behind a firewall (my case).

As, also mentioned on your site, push gateway is usually not the right solution. That's why I want to use AMQP.

With that said - I understand that adding AMQP might not be something you want to look into, and appreciate this.
So - a new suggestion: How about a plugin-like system for adding scrapers?
This can be done in two ways:

  1. Actual plugin (some C/Go .so file to load with code doing the calls).
  2. A more elaborate protocol and configurations for scraping using a proxy. So that we could have a single proxy process, which has no special configuration, it will be scraped by localhost http and forward the request in the target protocol. (Example changes needed: scraping of different processes with the same port. So that I could scrape two jobs by http scraping the same localhost:8080/metrics endpoint, but with different parameters (for example "?actual=amqps://whatever/")).
@brian-brazil

This comment has been minimized.

Copy link
Member

brian-brazil commented May 30, 2016

they may just live behind a firewall (my case).

We recommend running Prometheus on the same network as what you're monitoring.

We already support 2, see how the blackbox exporter works for example.

@mishas

This comment has been minimized.

Copy link
Author

mishas commented May 30, 2016

The one thing that I'm missing in the blackbox example, is a call for init.
I want my proxy to be called once, when prometheus loads, to create a single connection that I can use later.
I can obviously do it on first scrape call, but then it might take longer to connect than the timeout, and if it fails, I don't know if it's the scrape that failed or the proxy.
But - I think it's good enough for now. Thanks!

@juliusv

This comment has been minimized.

Copy link
Member

juliusv commented Jun 2, 2016

Closing this as we're not likely to add non-HTTP scraper support and a workaround has been found.

@juliusv juliusv closed this Jun 2, 2016

@sylr

This comment has been minimized.

Copy link
Contributor

sylr commented Feb 21, 2018

Greetings.

Even if this has been discarded I'd like to tell you why I need this today.

My company is going to deploy hundreds of servers at clients and we need to export the metrics of this servers and aggregate them in a single place. As prometheus provide no authentication we can't use it as it because we can not expose the push gateway on internet without any authentication.

So we thought about it and we already have an authenticated path between the servers at the clients and us, rabbitmq. So we are going to write something that is going to poll the node exporter locally on the servers and send the result to rabbitmq.

It would have been nice if promrtheus was able to natively poll rabbitmq queues, it would have spared us to develop something that polls queues and send the messages to the push gateway.

Regards.

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 22, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 22, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.