Prometheus
Integration of FASTPANEL with Prometheus for metrics collection
This feature is available exclusively for users with an Extended License.
FASTPANEL® now supports integration with Prometheus for collecting system metrics. This guide will walk you through the steps needed to add your FASTPANEL® instance to Prometheus, allowing you to gather and monitor system metrics in real time.
Create a Token
To allow Prometheus to collect metrics, you need to create a special token with limited access:
-
Connect to your FASTPANEL® server via SSH.
-
Run the following command to create a token:
mogwai users tokens add -n metrics_test_token -s read_only -s metrics_only
- metrics_test_token is a custom name for the token; you can choose any name
- The token will be granted the following scopes:
- read_only — read-only access
- metrics_only — access restricted to metrics
Add a job to Prometheus
Once the token is created, you need to configure Prometheus to start scraping metrics from your FASTPANEL® instance.
Open your Prometheus configuration file and add a new job:
- job_name: "fastpanel2"
scheme: https
static_configs:
- targets: ["$IP:8888"]
metrics_path: /api/metrics
tls_config:
insecure_skip_verify: true
bearer_token: I_AM_TOKEN
scrape_interval: 60s
- job_name — a custom name for the job
- targets — the IP address and port of your FASTPANEL® server. Replace
$IP
with your servers IP address - metrics_path — the API endpoint to fetch metrics from
- bearer_token — replace this with your generated token (metrics_test_token)
- scrape_interval — how often Prometheus should scrape the metrics (set to 60 seconds in this case)
Configure the Monitoring Dashboard
After successfully adding your FASTPANEL® instance to Prometheus, you can set up your first dashboard to visualize the collected metrics.
You can get a pre-built Grafana dashboard specifically for FASTPANEL® metrics using the following link:
FASTPANEL Dashboard
For importing the dashboard, please follow this guide.
Now Prometheus will start collecting metrics from your FASTPANEL® instance, enabling you to monitor system performance in real time.