prometheus-only-example.yaml 3.4 KB
Newer Older
F
v1.6.0  
frf12 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
## Only need to configure when remote login is required
# user:
#   username: your username
#   password: your password if need
#   key_file: your ssh-key file path if need
#   port: your ssh port, default 22
#   timeout: ssh connection timeout (second), default 30
prometheus:
  servers:
    - 192.168.1.5
  global:
    # The working directory for prometheus. prometheus is started under this directory. This is a required field.
    home_path: /root/prometheus
    # address: 0.0.0.0  # The ip address to bind to. Along with port, corresponds to the `web.listen-address` parameter.
    # port: 9090 # The http port to use. Along with address, corresponds to the `web.listen-address` parameter.
    # enable_lifecycle: true # Enable shutdown and reload via HTTP request. Corresponds to the `web.enable-lifecycle` parameter.
    # data_dir: /root/prometheus/data # Base path for metrics storage. Corresponds to the `storage.tsdb.path` parameter.
    # basic_auth_users:  # Usernames and passwords that have full access to the web server via basic authentication. Corresponds to the `basic_auth_users` parameter.
    #   <username>: <password>  # The format of `basic_auth_users` : the key is the user name and the value is the password.
    # web_config: # Content of Prometheus web service config file. The format is consistent with the file. However, `basic_auth_users` cannot be set in it. Please set `basic_auth_users` above if needed. Corresponds to the `web.config.file` parameter.
    #   tls_server_config:
    #     # Certificate and key files for server to use to authenticate to client.
    #     cert_file: <filename>
    #     key_file: <filename>
    # config: # Configuration of the Prometheus service. The format is consistent with the Prometheus config file. Corresponds to the `config.file` parameter.
    #   rule_files:
    #   - rules/*rules.yaml
    #   scrape_configs:
    #   - job_name: prometheus
    #     metrics_path: /metrics
    #     scheme: http
    #     static_configs:
    #       - targets:
    #           - localhost:9090
    #   - job_name: node
    #     basic_auth:
    #       username: admin
    #       password: root
    #     metrics_path: /metrics/node/host
    #     scheme: http
    #     file_sd_configs:  # Set the targets to be collected by reading local files. The example is to collect targets corresponding to all yaml files in the 'targets' directory under $home_path.
    #     - files:
    #       - 'targets/*.yaml'
    #   - job_name: ob_basic
    #     basic_auth:
    #       username: admin
    #       password: root
    #     metrics_path: /metrics/ob/basic
    #     scheme: http
    #     file_sd_configs:
    #     - files:
    #       - 'targets/*.yaml'
    #   - job_name: ob_extra
    #     basic_auth:
    #       username: admin
    #       password: root
    #     metrics_path: /metrics/ob/extra
    #     scheme: http
    #     file_sd_configs:
    #     - files:
    #       - 'targets/*.yaml'
    #   - job_name: agent
    #     basic_auth:
    #       username: admin
    #       password: root
    #     metrics_path: /metrics/stat
    #     scheme: http
    #     file_sd_configs:
    #     - files:
    #       - 'targets/*.yaml'
    # additional_parameters: # Additional parameters for Prometheus service, among which `web.listen-address`, `web.enable-lifecycle`, `storage.tsdb.path`, `config.file` and `web.config.file` cannot be set. Please set them in the corresponding configuration above if needed.
    # - log.level: debug