Prometheus: Configure Prometheus server to scrape data from Node Exporter
This documentation is part of the Retrieving metrics from Linux guide. You can view the complete guide here: How to retrieve Linux server metrics in Prometheus using Node Exporter.
👋 Welcome to the Stackhero documentation!
Stackhero offers a ready-to-use Prometheus cloud solution that provides numerous benefits, including:
Alert Managerincluded to send alerts toSlack,Mattermost,PagerDuty, etc.- Dedicated email server to send unlimited email alerts.
Blackboxto probeHTTP,ICMP,TCP, and more.- Easy configuration with an online configuration file editor.
- Effortless updates with just a click.
- Optimal performance and robust security powered by a private and dedicated VM.
Save time and simplify your life: it only takes 5 minutes to try Stackhero's Prometheus cloud hosting solution!
After installing Node Exporter and securing it, configure your Prometheus server to scrape metrics on a regular schedule.
On Stackhero, select your Prometheus service and go to the "Prometheus configuration" URL. Then add the following to your scrape_configs section:
scrape_configs:
- job_name: "My servers pool"
static_configs:
- targets: [ "<yourLinuxServerDomain>:9100" ]
basic_auth:
username: "prometheus"
password: "<password>"
scheme: https
tls_config:
insecure_skip_verify: true
# Relabeling "instance" to remove the ":9100" part
relabel_configs:
- source_labels: [__address__]
target_label: instance
regex: '([^:]+)(:[0-9]+)?'
replacement: '${1}'
Save the file and check your Prometheus logs to confirm that it has reloaded successfully (you can view the logs from the Stackhero dashboard by selecting your Prometheus service and clicking on the "Logs" tab).
Finally, verify that Prometheus is scraping metrics by accessing the Prometheus UI on the Stackhero dashboard and navigating to Status > Targets. Your Linux server should appear in the target list as UP.
The target "myLinuxServer" is UP