Prometheus Setup

Generates a scrape config for Prometheus' http_sd. The endpoint serves the current node set from this registry mirror, so targets follow registry changes without editing the config again.

Nodes assigned to one subnet.
how Prometheus reaches this service
Options
prometheus.yml
scrape_configs:
  - job_name: "ic-sd"
    scheme: https
    scrape_interval: "30s"
    tls_config:
      insecure_skip_verify: true
    http_sd_configs:
      - url: /api/s/tdb26-jop6k-aogll-7ltgs-eruif-6kk7m-qpktf-gdiqx-mxtrf-vb5e6-eqe
        refresh_interval: "1m"
    relabel_configs:
      - source_labels: [node_id]
        target_label: instance

scheme: https is required. Routing HostOS and GuestOS to their separate metrics paths needs no relabel_configs; the path arrives in the discovery response. Any rules above come from the options.