If you are getting “is not a valid hostname prometheus” when trying to setup Prometheus, then you likely added a full URI, but Prometheus only accepts a hostname, so if you want to add a URL you need to add the hostname and then change “metrics_path”.
By default “metrics_path” is “/metrics”, so if it is that, then you don’t need to define it, otherwise it looks like this:
— targets: [‘mykevinwebsite.com’]
The reason is to keep your config more simple and have fewer errors so that every host can have a different path.
I also wrote an article about how to use Prometheus with Kubernetes, read it here!