mc admin prometheus 命令生成用于 Prometheus 的配置文件。语法如下:
C:\> mc admin prometheus -h
NAME:
mc admin prometheus - manages prometheus config
USAGE:
mc admin prometheus COMMAND [COMMAND FLAGS | -h] [ARGUMENTS...]
COMMANDS:
generate generates prometheus config
FLAGS:
--config-dir value, -C value path to configuration folder (default: "C:\\Users\\Administrator\\mc")
--quiet, -q disable progress bar display
--no-color disable color theme
--json enable JSON lines formatted output
--debug enable debug output
--insecure disable SSL certificate verification
--help, -h show help其中,generate 子命令用来生成 prometheus 配置,生成一个 JWT 承载(bearer)令牌,用于配置 Prometheus 集合。该命令具有以下语法:
C:\> mc admin prometheus generate -h
NAME:
mc admin prometheus generate - generates prometheus config
USAGE:
mc admin prometheus generate TARGET
FLAGS:
--public disable bearer token generation for scrape_configs
--config-dir value, -C value path to configuration folder (default: "C:\\Users\\Administrator\\mc")
--quiet, -q disable progress bar display
--no-color disable color theme
--json enable JSON lines formatted output
--debug enable debug output
--insecure disable SSL certificate verification
--help, -h show help(1)生成默认的 prometheus 配置。
D:\server\minio>mc admin prometheus generate local
scrape_configs:
- job_name: minio-job
bearer_token: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjQ3ODAzNTU0NTcsImlzcyI6InByb21ldGhldXMiLCJzdWIiOiJyb290In0.B9PHvrTiLhjTd83tkz4Z6ikZ8XX_flk-NjK232wD-qRigNhfowRyuOduwhjkxtgpIsYwCuP2S45LyEzBSpm7fg
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets: ['127.0.0.1:9000']