@Abel Luck have you checked out the example configs for DNS service discovery?
-
https://prometheus.io/docs/prometheus/latest/configuration/configuration/#dns_sd_config-
https://github.com/prometheus/prometheus/blob/release-2.10/config/testdata/conf.good.yml#L79-L123That's a full example that touches most of the things you mentioned
- endpoint lookup by DNS name (Lines 96-99)
- custom
/metrics path (Line 90)
- and to get a custom port, I'd replace Line 91 (
scheme: https) with
port: <custom#>