Prometheus监控Minio

概述

线上需要监控Minio(一个用go写的分布式文件存储组件),特地找了下minio官网,现在做记录如下!
minio更新版本太快了,一般一个月更新4-6个版本,我们线上的版本是2020-12-03,距离现在最新版本(2021-10-03)差了差不多40个版本,期间minio换了不少东西

Minio本身提供的监控

minio自身提供了Prometheus监控的指标数据,分为两种形式获取:

  • 开放形式获取(不需要任何认证)
  • 需要通过认证获取

无认证获取

在你启动minio之前加上这段代码

#公开minio的prometheus的指标接口获取,不需要认证
export MINIO_PROMETHEUS_AUTH_TYPE="public"

#prometheus配置(和认证的就差了一个beare_token配置)
scrape_configs:
- job_name: minio-job
  metrics_path: /minio/v2/metrics/cluster
  scheme: http
  static_configs:
  - targets: ['172.16.16.46:19000']
复制代码

认证获取

  1. 下载minio的客户端mc
wget https://dl.min.io/client/mc/release/linux-amd64/mc 
chmod +x mc
复制代码
  1. 设置alias(别名)
#查看目前的别名信息
./mc alias list

gcs
  URL       : https://storage.googleapis.com
  AccessKey : YOUR-ACCESS-KEY-HERE
  SecretKey : YOUR-SECRET-KEY-HERE
  API       : S3v2
  Path      : dns

local  
  URL       : http://localhost:9000
  AccessKey : 
  SecretKey : 
  API       : 
  Path      : auto

myminio
  URL       : http://172.16.16.46:19000
  AccessKey : minioadmin
  SecretKey : minioadmin
  API       : s3v4
  Path      : auto

play   
  URL       : https://play.min.io
  AccessKey : Q3AM3UQ867SPQQA43P2F
  SecretKey : zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
  API       : S3v4
  Path      : auto

s3     
  URL       : https://s3.amazonaws.com
  AccessKey : YOUR-ACCESS-KEY-HERE
  SecretKey : YOUR-SECRET-KEY-HERE
  API       : S3v4
  Path      : dns


#设置别名
./mc alias set liuxu http://172.16.16.46:19000

会提示你输入用户名和密码,如下:

Enter Access Key: minioadmin
Enter Secret Key: 
Added `liuxu` successfully.

#再次执行 ./mc alias list可以看到新添加的别名信息
gcs    
  URL       : https://storage.googleapis.com
  AccessKey : YOUR-ACCESS-KEY-HERE
  SecretKey : YOUR-SECRET-KEY-HERE
  API       : S3v2
  Path      : dns

liuxu  //新添加的liuxu别名信息
  URL       : http://172.16.16.46:19000
  AccessKey : minioadmin
  SecretKey : minioadmin
  API       : s3v4
  Path      : auto

local  
  URL       : http://localhost:9000
  AccessKey : 
  SecretKey : 
  API       : 
  Path      : auto

myminio
  URL       : http://172.16.16.46:19000
  AccessKey : minioadmin
  SecretKey : minioadmin
  API       : s3v4
  Path      : auto

play   
  URL       : https://play.min.io
  AccessKey : Q3AM3UQ867SPQQA43P2F
  SecretKey : zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
  API       : S3v4
  Path      : auto

s3     
  URL       : https://s3.amazonaws.com
  AccessKey : YOUR-ACCESS-KEY-HERE
  SecretKey : YOUR-SECRET-KEY-HERE
  API       : S3v4
  Path      : dns

复制代码
  1. 生成prometheus配置
#执行的命令为 ./mc admin prometheus generate 你创建的别名
./mc admin prometheus generate liuxu

#得到的结果为(prometheus的配置信息,看着进行增减,但是别修改bearer_token信息)
scrape_configs:
- job_name: minio-job
  bearer_token: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjQ3ODcyOTA5MjYsImlzcyI6InByb21ldGhldXMiLCJzdWIiOiJtaW5pb2FkbWluIn0.v8yBkdj1CS15Qcvy87RJLzncb7oP8hyJl_qVvRXXU-qykWCA-vS2r1_DG4tVG8Ua-9jO5tCqUxrnaTzF5ApE0Q
  metrics_path: /minio/v2/metrics/cluster
  scheme: http
  static_configs:
  - targets: ['172.16.16.46:19000']
复制代码
  1. 通过curl验证下(由于需要Authorization头部信息,所以浏览器直接访问不行)
curl -v -sSL -H 'Authorization: Bearer 你上面申请的token' http://172.16.16.46:19000/minio/v2/metrics/cluster

示例:
curl -v -sSL -H 'Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjQ3ODcyOTA5MjYsImlzcyI6InByb21ldGhldXMiLCJzdWIiOiJtaW5pb2FkbWluIn0.v8yBkdj1CS15Qcvy87RJLzncb7oP8hyJl_qVvRXXU-qykWCA-vS2r1_DG4tVG8Ua-9jO5tCqUxrnaTzF5ApE0Q' http://172.16.16.46:19000/minio/v2/metrics/cluster

应该会看到如下信息:
*   Trying 172.16.16.46:19000...
* TCP_NODELAY set
* Connected to 172.16.16.46 (172.16.16.46) port 19000 (#0)
> GET /minio/v2/metrics/cluster HTTP/1.1
> Host: 172.16.16.46:19000
> User-Agent: curl/7.68.0
> Accept: */*
> Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjQ3ODcyODA0MTQsImlzcyI6InByb21ldGhldXMiLCJzdWIiOiJtaW5pb2FkbWluIn0.tUdrUndyicdBqN4P16jMXfBtdZKT_xh4pvW1ElijJU5KHYkOJAZ4qIHeTGbo7PG7ZeLmSlRs6JSG2RIrWAABGw
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Content-Security-Policy: block-all-mixed-content
< Content-Type: text/plain; version=0.0.4; charset=utf-8
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< Vary: Origin
< X-Amz-Request-Id: 16AC0989642F7DBC
< X-Content-Type-Options: nosniff
< X-Xss-Protection: 1; mode=block
< Date: Fri, 08 Oct 2021 11:07:30 GMT
< Transfer-Encoding: chunked
< 
# 下面全是Minio的指标数据信息
# HELP minio_bucket_objects_size_distribution Distribution of object sizes in the bucket, includes label for the bucket name.
# TYPE minio_bucket_objects_size_distribution gauge
minio_bucket_objects_size_distribution{bucket="liuxu",range="BETWEEN_1024_B_AND_1_MB",server="0.0.0.0:19000"} 8
minio_bucket_objects_size_distribution{bucket="liuxu",range="BETWEEN_10_MB_AND_64_MB",server="0.0.0.0:19000"} 0
minio_bucket_objects_size_distribution{bucket="liuxu",range="BETWEEN_128_MB_AND_512_MB",server="0.0.0.0:19000"} 0
minio_bucket_objects_size_distribution{bucket="liuxu",range="BETWEEN_1_MB_AND_10_MB",server="0.0.0.0:19000"} 2
minio_bucket_objects_size_distribution{bucket="liuxu",range="BETWEEN_64_MB_AND_128_MB",server="0.0.0.0:19000"} 0
minio_bucket_objects_size_distribution{bucket="liuxu",range="GREATER_THAN_512_MB",server="0.0.0.0:19000"} 0
minio_bucket_objects_size_distribution{bucket="liuxu",range="LESS_THAN_1024_B",server="0.0.0.0:19000"} 0
minio_bucket_objects_size_distribution{bucket="transfer",range="BETWEEN_1024_B_AND_1_MB",server="0.0.0.0:19000"} 649
minio_bucket_objects_size_distribution{bucket="transfer",range="BETWEEN_10_MB_AND_64_MB",server="0.0.0.0:19000"} 32
minio_bucket_objects_size_distribution{bucket="transfer",range="BETWEEN_128_MB_AND_512_MB",server="0.0.0.0:19000"} 10
minio_bucket_objects_size_distribution{bucket="transfer",range="BETWEEN_1_MB_AND_10_MB",server="0.0.0.0:19000"} 57
minio_bucket_objects_size_distribution{bucket="transfer",range="BETWEEN_64_MB_AND_128_MB",server="0.0.0.0:19000"} 3
minio_bucket_objects_size_distribution{bucket="transfer",range="GREATER_THAN_512_MB",server="0.0.0.0:19000"} 3
minio_bucket_objects_size_distribution{bucket="transfer",range="LESS_THAN_1024_B",server="0.0.0.0:19000"} 2
# HELP minio_bucket_usage_object_total Total number of objects
# TYPE minio_bucket_usage_object_total gauge
minio_bucket_usage_object_total{bucket="liuxu",server="0.0.0.0:19000"} 10
minio_bucket_usage_object_total{bucket="transfer",server="0.0.0.0:19000"} 756
# HELP minio_bucket_usage_total_bytes Total bucket size in bytes
# TYPE minio_bucket_usage_total_bytes gauge
minio_bucket_usage_total_bytes{bucket="liuxu",server="0.0.0.0:19000"} 9.373386e+06
minio_bucket_usage_total_bytes{bucket="transfer",server="0.0.0.0:19000"} 6.108739269e+09
# HELP minio_cluster_disk_free_inodes Total free inodes.
# TYPE minio_cluster_disk_free_inodes gauge
minio_cluster_disk_free_inodes{disk="/media/liuxu/data/rattrap/component/minio/data",server="0.0.0.0:19000"} 0
# HELP minio_cluster_nodes_offline_total Total number of MinIO nodes offline.
# TYPE minio_cluster_nodes_offline_total gauge
minio_cluster_nodes_offline_total{server="0.0.0.0:19000"} 0
# HELP minio_cluster_nodes_online_total Total number of MinIO nodes online.
# TYPE minio_cluster_nodes_online_total gauge
minio_cluster_nodes_online_total{server="0.0.0.0:19000"} 1
# HELP minio_inter_node_traffic_errors_total Total number of failed internode calls.
# TYPE minio_inter_node_traffic_errors_total counter
minio_inter_node_traffic_errors_total{server="0.0.0.0:19000"} 0
# HELP minio_inter_node_traffic_received_bytes Total number of bytes received from other peer nodes.
# TYPE minio_inter_node_traffic_received_bytes counter
minio_inter_node_traffic_received_bytes{server="0.0.0.0:19000"} 0
# HELP minio_inter_node_traffic_sent_bytes Total number of bytes sent to the other peer nodes.
# TYPE minio_inter_node_traffic_sent_bytes counter
minio_inter_node_traffic_sent_bytes{server="0.0.0.0:19000"} 1.905945e+06
# HELP minio_node_disk_free_bytes Total storage available on a disk.
# TYPE minio_node_disk_free_bytes gauge
minio_node_disk_free_bytes{disk="/media/liuxu/data/rattrap/component/minio/data",server="0.0.0.0:19000"} 2.36991361024e+11
# HELP minio_node_disk_total_bytes Total storage on a disk.
# TYPE minio_node_disk_total_bytes gauge
minio_node_disk_total_bytes{disk="/media/liuxu/data/rattrap/component/minio/data",server="0.0.0.0:19000"} 3.45587699712e+11
# HELP minio_node_disk_used_bytes Total storage used on a disk.
# TYPE minio_node_disk_used_bytes gauge
minio_node_disk_used_bytes{disk="/media/liuxu/data/rattrap/component/minio/data",server="0.0.0.0:19000"} 1.08596338688e+11
# HELP minio_node_file_descriptor_limit_total Limit on total number of open file descriptors for the MinIO Server process.
# TYPE minio_node_file_descriptor_limit_total gauge
minio_node_file_descriptor_limit_total{server="0.0.0.0:19000"} 1.048576e+06
# HELP minio_node_file_descriptor_open_total Total number of open file descriptors by the MinIO Server process.
# TYPE minio_node_file_descriptor_open_total gauge
minio_node_file_descriptor_open_total{server="0.0.0.0:19000"} 14
# HELP minio_node_go_routine_total Total number of go routines running.
# TYPE minio_node_go_routine_total gauge
minio_node_go_routine_total{server="0.0.0.0:19000"} 34
# HELP minio_node_ilm_expiry_pending_tasks Number of pending ILM expiry tasks in the queue.
# TYPE minio_node_ilm_expiry_pending_tasks gauge
minio_node_ilm_expiry_pending_tasks{server="0.0.0.0:19000"} 0
# HELP minio_node_ilm_transition_active_tasks Number of active ILM transition tasks.
# TYPE minio_node_ilm_transition_active_tasks gauge
minio_node_ilm_transition_active_tasks{server="0.0.0.0:19000"} 0
# HELP minio_node_ilm_transition_pending_tasks Number of pending ILM transition tasks in the queue.
# TYPE minio_node_ilm_transition_pending_tasks gauge
minio_node_ilm_transition_pending_tasks{server="0.0.0.0:19000"} 0
# HELP minio_node_ilm_versions_scanned Total number of object versions checked for ilm actions since server start
# TYPE minio_node_ilm_versions_scanned counter
minio_node_ilm_versions_scanned{server="0.0.0.0:19000"} 0
# HELP minio_node_io_rchar_bytes Total bytes read by the process from the underlying storage system including cache, /proc/[pid]/io rchar
# TYPE minio_node_io_rchar_bytes counter
minio_node_io_rchar_bytes{server="0.0.0.0:19000"} 1.2284495269e+10
# HELP minio_node_io_read_bytes Total bytes read by the process from the underlying storage system, /proc/[pid]/io read_bytes
# TYPE minio_node_io_read_bytes counter
minio_node_io_read_bytes{server="0.0.0.0:19000"} 2.3855104e+07
# HELP minio_node_io_wchar_bytes Total bytes written by the process to the underlying storage system including page cache, /proc/[pid]/io wchar
# TYPE minio_node_io_wchar_bytes counter
minio_node_io_wchar_bytes{server="0.0.0.0:19000"} 1.2978713407e+10
# HELP minio_node_io_write_bytes Total bytes written by the process to the underlying storage system, /proc/[pid]/io write_bytes
# TYPE minio_node_io_write_bytes counter
minio_node_io_write_bytes{server="0.0.0.0:19000"} 6.786367488e+09
# HELP minio_node_process_cpu_total_seconds Total user and system CPU time spent in seconds.
# TYPE minio_node_process_cpu_total_seconds counter
minio_node_process_cpu_total_seconds{server="0.0.0.0:19000"} 89.85
# HELP minio_node_process_resident_memory_bytes Resident memory size in bytes.
# TYPE minio_node_process_resident_memory_bytes gauge
minio_node_process_resident_memory_bytes{server="0.0.0.0:19000"} 1.58400512e+08
# HELP minio_node_process_starttime_seconds Start time for MinIO process per node, time in seconds since Unix epoc.
# TYPE minio_node_process_starttime_seconds gauge
minio_node_process_starttime_seconds{server="0.0.0.0:19000"} 1.63367483872e+09
# HELP minio_node_process_uptime_seconds Uptime for MinIO process per node in seconds.
# TYPE minio_node_process_uptime_seconds gauge
minio_node_process_uptime_seconds{server="0.0.0.0:19000"} 16385.216406048
# HELP minio_node_scanner_bucket_scans_finished Total number of bucket scans finished since server start
# TYPE minio_node_scanner_bucket_scans_finished counter
minio_node_scanner_bucket_scans_finished{server="0.0.0.0:19000"} 435
# HELP minio_node_scanner_bucket_scans_started Total number of bucket scans started since server start
# TYPE minio_node_scanner_bucket_scans_started counter
minio_node_scanner_bucket_scans_started{server="0.0.0.0:19000"} 435
# HELP minio_node_scanner_directories_scanned Total number of directories scanned since server start.
# TYPE minio_node_scanner_directories_scanned counter
minio_node_scanner_directories_scanned{server="0.0.0.0:19000"} 492
# HELP minio_node_scanner_objects_scanned Total number of unique objects scanned since server start.
# TYPE minio_node_scanner_objects_scanned counter
minio_node_scanner_objects_scanned{server="0.0.0.0:19000"} 1387
# HELP minio_node_scanner_versions_scanned Total number of object versions scanned since server start.
# TYPE minio_node_scanner_versions_scanned counter
minio_node_scanner_versions_scanned{server="0.0.0.0:19000"} 1387
# HELP minio_node_syscall_read_total Total read SysCalls to the kernel. /proc/[pid]/io syscr
# TYPE minio_node_syscall_read_total counter
minio_node_syscall_read_total{server="0.0.0.0:19000"} 1.761354e+06
# HELP minio_node_syscall_write_total Total write SysCalls to the kernel. /proc/[pid]/io syscw
# TYPE minio_node_syscall_write_total counter
minio_node_syscall_write_total{server="0.0.0.0:19000"} 407469
# HELP minio_s3_requests_errors_total Total number S3 requests with errors
# TYPE minio_s3_requests_errors_total counter
minio_s3_requests_errors_total{api="getbucketencryption",server="0.0.0.0:19000"} 1
minio_s3_requests_errors_total{api="getbucketlocation",server="0.0.0.0:19000"} 1
minio_s3_requests_errors_total{api="getbucketpolicy",server="0.0.0.0:19000"} 1
# HELP minio_s3_requests_inflight_total Total number of S3 requests currently in flight
# TYPE minio_s3_requests_inflight_total gauge
minio_s3_requests_inflight_total{api="getbucketencryption",server="0.0.0.0:19000"} 0
minio_s3_requests_inflight_total{api="getbucketlocation",server="0.0.0.0:19000"} 0
minio_s3_requests_inflight_total{api="getbucketpolicy",server="0.0.0.0:19000"} 0
minio_s3_requests_inflight_total{api="getobject",server="0.0.0.0:19000"} 0
minio_s3_requests_inflight_total{api="headobject",server="0.0.0.0:19000"} 0
minio_s3_requests_inflight_total{api="listobjectsv2",server="0.0.0.0:19000"} 0
minio_s3_requests_inflight_total{api="putbucket",server="0.0.0.0:19000"} 0
minio_s3_requests_inflight_total{api="putobject",server="0.0.0.0:19000"} 0
# HELP minio_s3_requests_rejected_auth_total Total number S3 requests rejected for auth failure.
# TYPE minio_s3_requests_rejected_auth_total counter
minio_s3_requests_rejected_auth_total{server="0.0.0.0:19000"} 0
# HELP minio_s3_requests_rejected_header_total Total number S3 requests rejected for invalid header.
# TYPE minio_s3_requests_rejected_header_total counter
minio_s3_requests_rejected_header_total{server="0.0.0.0:19000"} 0
# HELP minio_s3_requests_rejected_invalid_total Total number S3 invalid requests.
# TYPE minio_s3_requests_rejected_invalid_total counter
minio_s3_requests_rejected_invalid_total{server="0.0.0.0:19000"} 0
# HELP minio_s3_requests_rejected_timestamp_total Total number S3 requests rejected for invalid timestamp.
# TYPE minio_s3_requests_rejected_timestamp_total counter
minio_s3_requests_rejected_timestamp_total{server="0.0.0.0:19000"} 0
# HELP minio_s3_requests_total Total number S3 requests
# TYPE minio_s3_requests_total counter
minio_s3_requests_total{api="getbucketencryption",server="0.0.0.0:19000"} 1
minio_s3_requests_total{api="getbucketlocation",server="0.0.0.0:19000"} 51
minio_s3_requests_total{api="getbucketpolicy",server="0.0.0.0:19000"} 1
minio_s3_requests_total{api="getobject",server="0.0.0.0:19000"} 6
minio_s3_requests_total{api="headobject",server="0.0.0.0:19000"} 6
minio_s3_requests_total{api="listobjectsv2",server="0.0.0.0:19000"} 37
minio_s3_requests_total{api="putbucket",server="0.0.0.0:19000"} 2
minio_s3_requests_total{api="putobject",server="0.0.0.0:19000"} 766
# HELP minio_s3_requests_waiting_total Number of S3 requests in the waiting queue
# TYPE minio_s3_requests_waiting_total gauge
minio_s3_requests_waiting_total{server="0.0.0.0:19000"} 0
# HELP minio_s3_time_ttfb_seconds_distribution Distribution of the time to first byte across API calls.
# TYPE minio_s3_time_ttfb_seconds_distribution gauge
minio_s3_time_ttfb_seconds_distribution{api="getbucketencryption",le="0.050",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketencryption",le="0.100",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketencryption",le="0.250",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketencryption",le="0.500",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketencryption",le="1.000",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketencryption",le="10.000",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketencryption",le="2.500",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketencryption",le="5.000",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketlocation",le="0.050",server="0.0.0.0:19000"} 51
minio_s3_time_ttfb_seconds_distribution{api="getbucketlocation",le="0.100",server="0.0.0.0:19000"} 51
minio_s3_time_ttfb_seconds_distribution{api="getbucketlocation",le="0.250",server="0.0.0.0:19000"} 51
minio_s3_time_ttfb_seconds_distribution{api="getbucketlocation",le="0.500",server="0.0.0.0:19000"} 51
minio_s3_time_ttfb_seconds_distribution{api="getbucketlocation",le="1.000",server="0.0.0.0:19000"} 51
minio_s3_time_ttfb_seconds_distribution{api="getbucketlocation",le="10.000",server="0.0.0.0:19000"} 51
minio_s3_time_ttfb_seconds_distribution{api="getbucketlocation",le="2.500",server="0.0.0.0:19000"} 51
minio_s3_time_ttfb_seconds_distribution{api="getbucketlocation",le="5.000",server="0.0.0.0:19000"} 51
minio_s3_time_ttfb_seconds_distribution{api="getbucketpolicy",le="0.050",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketpolicy",le="0.100",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketpolicy",le="0.250",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketpolicy",le="0.500",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketpolicy",le="1.000",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketpolicy",le="10.000",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketpolicy",le="2.500",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getbucketpolicy",le="5.000",server="0.0.0.0:19000"} 1
minio_s3_time_ttfb_seconds_distribution{api="getobject",le="0.050",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="getobject",le="0.100",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="getobject",le="0.250",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="getobject",le="0.500",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="getobject",le="1.000",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="getobject",le="10.000",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="getobject",le="2.500",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="getobject",le="5.000",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="headobject",le="0.050",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="headobject",le="0.100",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="headobject",le="0.250",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="headobject",le="0.500",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="headobject",le="1.000",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="headobject",le="10.000",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="headobject",le="2.500",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="headobject",le="5.000",server="0.0.0.0:19000"} 6
minio_s3_time_ttfb_seconds_distribution{api="listobjectsv2",le="0.050",server="0.0.0.0:19000"} 35
minio_s3_time_ttfb_seconds_distribution{api="listobjectsv2",le="0.100",server="0.0.0.0:19000"} 36
minio_s3_time_ttfb_seconds_distribution{api="listobjectsv2",le="0.250",server="0.0.0.0:19000"} 36
minio_s3_time_ttfb_seconds_distribution{api="listobjectsv2",le="0.500",server="0.0.0.0:19000"} 36
minio_s3_time_ttfb_seconds_distribution{api="listobjectsv2",le="1.000",server="0.0.0.0:19000"} 36
minio_s3_time_ttfb_seconds_distribution{api="listobjectsv2",le="10.000",server="0.0.0.0:19000"} 37
minio_s3_time_ttfb_seconds_distribution{api="listobjectsv2",le="2.500",server="0.0.0.0:19000"} 36
minio_s3_time_ttfb_seconds_distribution{api="listobjectsv2",le="5.000",server="0.0.0.0:19000"} 37
minio_s3_time_ttfb_seconds_distribution{api="putbucket",le="0.050",server="0.0.0.0:19000"} 2
minio_s3_time_ttfb_seconds_distribution{api="putbucket",le="0.100",server="0.0.0.0:19000"} 2
minio_s3_time_ttfb_seconds_distribution{api="putbucket",le="0.250",server="0.0.0.0:19000"} 2
minio_s3_time_ttfb_seconds_distribution{api="putbucket",le="0.500",server="0.0.0.0:19000"} 2
minio_s3_time_ttfb_seconds_distribution{api="putbucket",le="1.000",server="0.0.0.0:19000"} 2
minio_s3_time_ttfb_seconds_distribution{api="putbucket",le="10.000",server="0.0.0.0:19000"} 2
minio_s3_time_ttfb_seconds_distribution{api="putbucket",le="2.500",server="0.0.0.0:19000"} 2
minio_s3_time_ttfb_seconds_distribution{api="putbucket",le="5.000",server="0.0.0.0:19000"} 2
minio_s3_time_ttfb_seconds_distribution{api="putobject",le="0.050",server="0.0.0.0:19000"} 766
minio_s3_time_ttfb_seconds_distribution{api="putobject",le="0.100",server="0.0.0.0:19000"} 766
minio_s3_time_ttfb_seconds_distribution{api="putobject",le="0.250",server="0.0.0.0:19000"} 766
minio_s3_time_ttfb_seconds_distribution{api="putobject",le="0.500",server="0.0.0.0:19000"} 766
minio_s3_time_ttfb_seconds_distribution{api="putobject",le="1.000",server="0.0.0.0:19000"} 766
minio_s3_time_ttfb_seconds_distribution{api="putobject",le="10.000",server="0.0.0.0:19000"} 766
minio_s3_time_ttfb_seconds_distribution{api="putobject",le="2.500",server="0.0.0.0:19000"} 766
minio_s3_time_ttfb_seconds_distribution{api="putobject",le="5.000",server="0.0.0.0:19000"} 766
# HELP minio_s3_traffic_received_bytes Total number of s3 bytes received.
# TYPE minio_s3_traffic_received_bytes counter
minio_s3_traffic_received_bytes{server="0.0.0.0:19000"} 6.126618664e+09
# HELP minio_s3_traffic_sent_bytes Total number of s3 bytes sent
# TYPE minio_s3_traffic_sent_bytes counter
minio_s3_traffic_sent_bytes{server="0.0.0.0:19000"} 1.8946023e+07
# HELP minio_software_commit_info Git commit hash for the MinIO release.
# TYPE minio_software_commit_info gauge
minio_software_commit_info{commit="3a7c79e2c71f7b09974ff1a1c70e4d149a83a6a9",server="0.0.0.0:19000"} 0
# HELP minio_software_version_info MinIO Release tag for the server
# TYPE minio_software_version_info gauge
minio_software_version_info{server="0.0.0.0:19000",version="2021-10-06T23:36:31Z"} 0
# HELP minio_usage_last_activity_nano_seconds Time elapsed (in nano seconds) since last scan activity. This is set to 0 until first scan cycle
# TYPE minio_usage_last_activity_nano_seconds gauge
minio_usage_last_activity_nano_seconds{server="0.0.0.0:19000"} 4.231895294e+09
# HELP promhttp_metric_handler_requests_in_flight Current number of scrapes being served.
# TYPE promhttp_metric_handler_requests_in_flight gauge
promhttp_metric_handler_requests_in_flight 1
# HELP promhttp_metric_handler_requests_total Total number of scrapes by HTTP status code.
# TYPE promhttp_metric_handler_requests_total counter
promhttp_metric_handler_requests_total{code="200"} 689
promhttp_metric_handler_requests_total{code="500"} 0
promhttp_metric_handler_requests_total{code="503"} 0
* Connection #0 to host 172.16.16.46 left intact

复制代码
  1. 配置到prometheus.yml配置作业文件当中
不做展示了!
复制代码

遇到的问题

  1. 通过curl访问发现出现403,说没有权限
这个有以下可能的原因:
1.你的beare_token不对(你可能没有copy完全,或者是复制错误了)
2.你的Minio版本不对,我们目前使用的版本(2020-12-03)访问这个地址会报错http://你的minio的ip:端口/minio/v2/metrics/cluster,
  但是访问:http://minio的ip:port/minio/prometheus/metrics可以获取一些指标

但是/minio/prometheus/metrics获取的指标很不规范,很多指标都没有以minio_开头,所以,为了跟着官方来,建议,升级minio版本为最新版本,并且使用官方提供的grafana dashbord!虽然这个dashboard也有点问题,但是总体还是可以的
复制代码

参考

github.com/minio/minio… minio的github对prometheus说明配置
github.com/minio/minio… minio官方导出的指标的名字及其解释

后记

Minio更新的版本太快了,目前UI已经使用MinIO Console 并且网上的minio导出的prometheus配置大多是停留在半年之前的版本,minio在导出指标这块改动还是挺大的,我在搭建的时候也是疑惑,以为是自己搞错了来着,后来才晓得是:minio的版本不同,指标导出不同了,甚至指标导出的url都变化了!