Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSD interface and binary for spitting out file-sd #3658
Comments
gouthamve
changed the title
SD interface and binary
SD interface and binary for spitting out file-sd
Jan 5, 2018
This comment has been minimized.
This comment has been minimized.
|
started |
This comment has been minimized.
This comment has been minimized.
|
The SD provider/Discoverer should send only the updates and not all target groups on every update. in my tests currently Consul sends all updates where k8s send only the updates. |
This comment has been minimized.
This comment has been minimized.
|
We still want to keep the existing SDs compiled in to the release binary, right? This is primarily to have a better answer than "implement a file sd generator", if I understand correctly. |
This comment has been minimized.
This comment has been minimized.
|
Yes. Yes, this is a potential path to make things easier to swap in/out of Prometheus. |
This was referenced Jan 8, 2018
This comment has been minimized.
This comment has been minimized.
|
Should the SD implementations that people write as part of using the sd tool follow the same rule of only sending updates on the channel, and not the entire list of targets/labels? |
This comment has been minimized.
This comment has been minimized.
|
Preferably yes. It should not break if the whole list is sent down the
channel but only updates also should be supported.
…On Sun, Jan 14, 2018 at 10:14 AM Callum Styan ***@***.***> wrote:
Should the SD implementations that people write as part of using the sd
tool follow the same rule of only sending updates on the channel, and not
the entire list of targets/labels?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3658 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHA3H1ChbNcolon7xocQfx3upK5zAF8Dks5tKYZCgaJpZM4RUDUr>
.
|
cstyan
referenced this issue
Jan 21, 2018
Merged
add sd adapter for converting unsupported SD type to filesd #3720
This comment has been minimized.
This comment has been minimized.
|
how about using go plugins for this? just pass the plugin name when you start prometheus using an argument like |
This comment has been minimized.
This comment has been minimized.
|
or another idea is to use local socket communication and the Discoverer can be written on any language and just send its targets on the socket.
|
This comment has been minimized.
This comment has been minimized.
|
and another idea is to use grpc |
This comment has been minimized.
This comment has been minimized.
|
We have file as the universal transport :P It can be done in any language.
This is so that we have an answer for those looking to add new SD
mechanisms to prometheus server.
…On Sun 28 Jan, 2018, 7:41 PM Krasi Georgiev, ***@***.***> wrote:
and another idea is to use grpc
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3658 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHA3H2-Zbbo6nDKKkF_rbb_of4IiNc1Zks5tPIAigaJpZM4RUDUr>
.
|
This comment has been minimized.
This comment has been minimized.
|
I don't know just seems a bit awkward approach. |
This comment has been minimized.
This comment has been minimized.
|
might be worth some cons and pros for the different approaches before taking a final decision. one con I see is that file based SD assumes the Discoverer has access to the same file system as Prometheus. one Pro for grps is that it is quite popular and this might make it more clear how to use and implement. prometheus can provide a single grpc endpoint and any Discoverer would call that to update the targets list. |
This comment has been minimized.
This comment has been minimized.
|
What do you think if I start a google doc and ask for some feedback from all users that have opened a PR/issue to request for a new Discoverer implementation? The idea is to get some real use-cases and ideas how to solve this with the absolute minimum work needed to implement and minimum support overhead. |
This comment has been minimized.
This comment has been minimized.
|
The plugin discussion is over in #2037. I remain against plugins, having a clear demarcation point makes support much easier. Files are what we should use here, not inventing another generic integration point. |
This comment has been minimized.
This comment has been minimized.
|
@cstyan the way I understand @gouthamve's suggestion and my personal preference is that this tool would just spit out a file with the targets and should not be coupled with the Discovery manager in any way. The only resemblance or a requirement would be to implement the Discoverer interface so that if it gets popular it can be plugged in with a minimal effort. |
This comment has been minimized.
This comment has been minimized.
|
@krasi-georgiev we discussed further on irc, but I had initially implemented the way you're referring to. However, we realized that IMO doing all of this properly without using |
This comment has been minimized.
This comment has been minimized.
|
@cstyan yes I see what you mean. I opened a group post so lets wait a bit to read some more ideas. |
This comment has been minimized.
This comment has been minimized.
CAFxX
commented
Feb 8, 2018
•
|
Wouldn't it make more sense, and be more in line with the Prometheus pull model, to have a generic-purpose HTTP SD? Something identical to the file SD (maybe even easier, just pick one of JSON/YAML/TOML), but over HTTP(S) instead of the local file system. This would effectively decouple Prometheus from the infrastructure being monitored (the file SD requires colocating something to Prometheus, HTTP would lift this requirement) This ticket would simply transition to provide the skeleton of a daemon providing the HTTP endpoint to query (instead of the daemon that spits out files) Alternatively, if the pull model is not deemed a good fit for SD, then an HTTP push SD endpoint exposed by Prometheus would do just fine. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
CAFxX
commented
Feb 8, 2018
|
@cstyan the solution @brian-brazil is suggesting still assumes it's ok to colocate stuff on the prometheus server... beside this there is no "discussion" in that issue :/ |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@CAFxX The decision is to support one generic mechanism and not multiple. Having a HTTP based one would require people run a daemon while file_sd poses no such requirements. Having restrictions on the access to the prometheus server seems like a self-induced issue :) Having said that, there is a slight chance we would also support for HTTP based mechanism, but imo, file_sd works pretty well. |
This comment has been minimized.
This comment has been minimized.
CAFxX
commented
Feb 8, 2018
It wouldn't be an issue if a more generic method that didn't require file system access was supported :)
I'm pretty sure that, when applicable, file_sd works well. The problem is that it's not always applicable (as our "self-induced" issue clearly proves) |
This comment has been minimized.
This comment has been minimized.
|
You already have to colocate the Prometheus configuration file, why is a file_sd file an issue? Is there something I'm missing? |
This comment has been minimized.
This comment has been minimized.
CAFxX
commented
Feb 8, 2018
|
@cstyan off the top of my head, setting a URL in a configuration file (assuming we're talking about HTTP pull) and having a daemon (albeit a simple one) running are two pretty different things, no? In addition, if instead we used an HTTP push model (more similar to all existing SDs) that URL in the configuration would not even be required, and we would get as close as possible to full decoupling. |
This comment has been minimized.
This comment has been minimized.
|
Sorry, I thought you were referring to colocation of the files, not the processes. You can still run the file_sd adapter within the same container or k8s pod. |
This comment has been minimized.
This comment has been minimized.
That would require clients to know all Prometheus servers that want to monitor them which loses one of the big benefits of the top-down SD approach we take. If you want that there's already Consul&friends. |
This comment has been minimized.
This comment has been minimized.
CAFxX
commented
Feb 8, 2018
|
@brian-brazil I wasn't talking about clients. I'm talking about service discovery. We would like to plug in our service discovery mechanisms without colocating processes on the prometheus server. So only the service discovery "system" would need to be aware of the url of the prometheus server. You don't lose any benefit by doing this. |
This comment has been minimized.
This comment has been minimized.
|
That has the same disadvantages, someone can't spin up a random Prometheus and have SD work. I'm also not aware of any SD system that works this way, and we don't want to invent one. There's file_sd if you want to do this yourself for some reason. |
This comment has been minimized.
This comment has been minimized.
CAFxX
commented
Feb 8, 2018
•
|
@brian-brazil at risk of repeating myself, that would work if I was allowed to write a file to the filesystem of that specific prometheus server every time the services to be monitored change. In our organization that unfortunately is not an option, yet we have to make this work somehow. |
This comment has been minimized.
This comment has been minimized.
|
As Goutham says, this is a self-induced issue that I'm afraid we can't help you with. |
jamtur01
referenced this issue
Apr 4, 2018
Closed
adding support for generic service discovery #4041
This comment has been minimized.
This comment has been minimized.
|
I think we can close this since #3720 is merged |
brian-brazil
closed this
Jun 5, 2018
This comment has been minimized.
This comment has been minimized.
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. |
gouthamve commentedJan 5, 2018
We get a lot of requests and PRs for new SD mechanisms and the current moratorium doesn't help people wanting new SD mechanisms.
We need a simple daemon that people can just plug in their SD implementation and it spits out file-sd. For example, the main file could be simply:
And people can just run:
./sd --output.file=<path>And they can write their implementation and swap out
sd.Register(NoopSD())with something like:And then they can have file-sd like:
./sd <custom-flags for SD config> --output.file=<path>Now if this file-sd mechanism is being used by enough people, adding it to prometheus-server would be simple as its the same interface.
/cc @cstyan