Yes each module probably wants to be a separate job.
Multiple jobs can use the same YAML/JSON files with file_sd, so
you could create a single file (with just the hostnames/IPs) and
then use relabling to add the correct port number for each job.
-- Stuart Clark
--
Stuart Clark
Stuart, this is totally bespoke C++ Windows system, none of those :) The file-discovery seems able to pull out my targets but I can't find a good example how to structure my files. I suppose each Module A, B, C, ... should be the jobs, but I'd far rather not have to list each of my targets/servers once for every job when it's all the same.
Yes each module probably wants to be a separate job.
Multiple jobs can use the same YAML/JSON files with file_sd, so you could create a single file (with just the hostnames/IPs) and then use relabling to add the correct port number for each job.
-- Stuart Clark
I've been looking at the examples here https://prometheus.io/docs/guides/file-sd/ and I cannot see how I would apply relabeling as described - their final example is similar to my case and they duplicate the entire section for the same job on two targets. You seem to be suggesting that could be avoided but I cannot see how.
In your YAML/JSON files just have the bare IP/hostname (no port)
and then within each job you can use relabing to add the correct
port number.
-- Stuart Clark