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 designed for reliability and ease of use:
Alert Manageris included, allowing you to send alerts directly toSlack,Mattermost,PagerDuty, and other popular platforms.- A dedicated email server lets you send unlimited email alerts with no additional setup required.
Blackboxis included, so you can probeHTTP,ICMP,TCP, and more for comprehensive monitoring.- Simple configuration with the online configuration file editor—no need to manage YAML manually.
- Easy updates with just one click. Stackhero takes care of the upgrade process for you.
- Optimal performance and enhanced security thanks to your own private, dedicated VM.
Save time and make your life easier: 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