I am setting up prometheus/node_exporter on AWS EC2. With the following configuration
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=node_exporter
Group=node_exporter
Type=simple
ExecStart=/usr/local/bin/node_exporter
[Install]
WantedBy=multi-user.target
And I can access metrics by using curl with localhost. Something like the following
curl localhost:9100/metrics
I can access the metric via private IP address as well. For example
curl private_ip_address:9100/metrics
But, when I try to access it via public IP address. It's not working, got curl timeout.
curl public_ip_address:9100/metrics
I try accessing from the ipv4:9100
from the server itself and from my local machine. Both got the same issue.
How can I enable to make it accessible from the ipv4 address?