This is quite possible caused by permissions issue, as one of the folders files that docker is trying to use is owned by a different user/group from the one trying to use the docker-compose commands. Try to find the file/folder with the different permissions and change it to your user name and group, or use change the files by using something like:
You are trying to set up http endpoint monitoring with prometheus and blackbox_exporter by specifying something like the following:
- source_labels: [__address__]
- source_labels: [__param_target]
- target_label: __address__
but you are getting the error (in prometheus targets) that connection was refused.
First specify the ip protocol as ip4 if you are not using ip6 like:
And then make sure that you use the container IP address in the replacement field if you have started blackbox_exporter as a docker container (tip taken from here), which you can find by looking for the container IP address (docker inspect blackbox_exporter | grep IPAddress).
So your prometheus configuration should look like the following (different replacement IP):
prometheus.yml (blackbox_exporter as docker container)