FastDFS
Collect Metrics data from FastDFS
Installation and Configuration¶
Prerequisites¶
- Install DataKit
- Python >= 3.10
- Gunicorn = 23.0.0
- Flask = 3.1.0
- Prometheus_client = 0.21.1
Download fastdfs-exporter¶
fastdfs-exporteris an officially developed Exporter that converts FastDFS status into Prometheus Metrics format:
- Move the exporter directory to the /etc directory, and execute the following command to run exporter.main
- Configure Exporter to run in the background
- After starting, you can access the Metrics via
127.0.0.1:9036/metrics
DataKit Collector Configuration¶
Since FastDFS can directly expose Metrics url through JMX Exporter, it can be collected directly via the prom collector.
Go to conf.d/samples under the DataKit installation directory, and execute the following command:
cp prom.conf.sample prom-fastdfs.conf.conf
Adjust the content of prom-fastdfs.conf, mainly adjusting urls, as follows:
[[inputs.prom]]
## Exporter URLs.
urls = ["http://127.0.0.1:9036/metrics"]
## Stream Size.
## The source stream segmentation size, (defaults to 1).
## 0 source stream undivided.
# stream_size = 1
## Unix Domain Socket URL. Using socket to request data when not empty.
uds_path = ""
## Ignore URL request errors.
ignore_req_err = false
## Collector alias.
source = "fastdfs"
Adjust other configurations as needed, parameter adjustment instructions:
- urls:
PrometheusMetrics address, fill in the Metrics url exposed by the corresponding component here - source: Collector alias, it is recommended to distinguish
- interval: Collection interval
Restart Datakit¶
Metrics¶
| Metric | Description | Unit |
|---|---|---|
storage_join_time_seconds |
The time when the storage server joined the cluster. When this value is true, the namespace will stop accepting client writes | Int |
storage_up_time_seconds |
The last startup time (or the most recent restart time) of the storage server | Int |
storage_total_space_bytes |
Total disk space of the storage server | Int |
free_space_bytes |
Available disk space of the storage server | Int |
storage_connection_alloc_count |
Cumulative number of allocated connections (since startup) | Int |
storage_connection_current_count |
Current number of connections in use | Int |
storage_connection_max_count |
Maximum allowed number of connections | Int |
storage_total_delete_count |
Total number of file deletions | Int |
storage_success_download_count |
Number of successful file downloads | Int |
storage_total_modify_count |
Total number of file modifications | Int |
group_storage_server_count |
Number of storage servers in the storage group | Int |
group_active_storage_server_count |
Number of running storage servers in the storage group | Int |
group_disk_total_space_bytes |
Total disk space of the storage group | Int |
group_disk_free_space_bytes |
Remaining disk space of the storage group | Int |