Search code examples
prometheus

prometheus how to change instance name


  "targets": [ "10.123.175.30:9100", "10.125.150.14:9100" ],
    "labels": {
      "env": "dev",
      "job": "node",
      "group": "developer"
    }

for those targets, can I map those IP addresses to instance name ? such as host1:9100, host2:9100 (Grafana will have better display then.)

or modify /etc/hosts is best approach?


Solution

  • You need to feed in the host name to Prometheus in the first place, rather than an IP address. Prometheus will resolve it when scraping.