Description
Some use cases may need to scrape multiple endpoints on the same FQDN, such as localhost
.
For example, in a Kubernetes pod you might have multiple metrics endpoints to scrape, localhost:9100/metrics
, localhost:9101/my-metrics
, etc.
You can't just run another copy of the client and still get service discovery, since the client only forwards the FQDN.
What do you think about allowing the client to specify labels, ports, and metrics paths for discovery?
One way to do this might be changing --fqdn
to --endpoint
and maybe allowing it to be specified multiple times. An example --endpoint
value might be http://localhost:9100/metrics?app=myapp
, where app=myapp
would be turned into labels for discovery.
I can work on a PR if you think this or similar is a good idea.
Additionally, the same values could optionally be used for security, as talked about in PR #41.