I have a prometheus server set up with habitat. Then there are exporters running on app servers, that provide a binding to the prometheus app server on which port the exporter is running. This config should be written into the prometheus servers config template, so it can connect to the exporter.
So, I tried to add a config like this to the prometheus config template:
{{#if bind.prometheus-nginx}}
- job_name: 'nginx'
static_configs:
{{#each bind.prometheus-nginx.members as |target| ~}}
- targets: ['{{target.sys.ip}}:{{target.cfg.port}}']
{{/each ~}}
{{/if}}
This all does it its job, however it references the public ip of the node instead of the ip of the private network interface. Is there a way to get the IP address of other network interfaces of the node where the service is currently running?