Fabian Reinartz <
fab.re...@gmail.com> writes:
> Quite a bit of thought went into whether it makes sense to natively support
> generic key-value stores in some way.
> While they fit very well to do service discovery, they also allow endless
> different approaches to structure the data.
>
> Your implementation probably fits your use case perfectly. The next user
> might store data slightly differently and thus cannot use your
> implementation at all.
> So it makes only sense to support widely used/standardized formats (e.g.
> serversets for Zookeeper) natively.
> We are happy to extend native service discovery support, but with lack of
> standardization it's unfortunately not feasible for generic key-value
> stores.
>
> Does that make sense?
I understand the argument, but it's not one I would agree with.
You are right that an organization might have the relevant service
information in etcd in some in-house format. But by the same token they
might also have the information in a file, but in a different format to
the one supported by file_sd_config. I don't think it is unreasonable
for prometheus to dictate the format of the data in etcd, just as it
does for file_sd_config (or perhaps support a small number of different
conventions, as it does for dns_sd_config).
I don't have a strong view on what the format of the target information
in etcd should be. In our use, prometheus is consuming target
information from an etcd directory that exists just for prometheus; no
other part of the system looks at it, so any format is fine. I'd be
fine with changing the convention to match the adapter code in the blog
post, or a format that supports arbitrary labels as the file_sd_config
format does.
> Out of curiosity: What would've been awkward about the file-based approach
> for your use case?
We're running prometheus in a docker container. Running a separate
container to host the etcd file exporter program would be unwelcome. So
we'd have to derive a container image that runs both prometheus and the
exporter program. Which means adding something like supervisord to the
image.... Maintaining such a thing is not obviously preferable to
maintaining a non-mainline prometheus branch with built-in etcd service
discovery.
In other words, it doesn't matter *how* prometheus implements etcd
service discovery. It matters whether it implements it out of the box.
David