美文网首页
Prometheus 普罗米修斯监控https

Prometheus 普罗米修斯监控https

作者: Feng_Sir | 来源:发表于2021-04-28 15:12 被阅读0次

    gRPC 认证 和 同时提供http服务 - 简书 (jianshu.com)
    因为之前服务升级成了https,所以也要修改Prometheus 的配置

    [root@kudu-02 prometheus]# cat prometheus.yml 
    # my global config
    global:
      scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
      evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
      # scrape_timeout is set to the global default (10s).
    
    # Alertmanager configuration
    alerting:
      alertmanagers:
      - static_configs:
        - targets:
          # - alertmanager:9093
    
    # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
    rule_files:
      - "prometheus.rules.yml"
      # - "first_rules.yml"
      # - "second_rules.yml"
    
    # A scrape configuration containing exactly one endpoint to scrape:
    # Here it's Prometheus itself.
    scrape_configs:
      # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
      - job_name: 'prometheus'
    
        # metrics_path defaults to '/metrics'
        # scheme defaults to 'http'.
    
        static_configs:
        - targets: ['localhost:9090']
      - job_name: 'grpc-server'
        scheme: https
        tls_config:
          insecure_skip_verify: true
        static_configs:
          - targets: ['192.168.20.144:8888','192.168.20.144:8889']
            labels:
              group: 'server'
    [root@kudu-02 prometheus]# 
    

    <scheme>: a string that can take the values http or https

    Configures the scrape request's TLS settings.
    A <tls_config> allows configuring TLS connections.

    <tls_config>:
    # CA certificate to validate API server certificate with.
    [ ca_file: <filename> ]
    
    # Certificate and key files for client cert authentication to the server.
    [ cert_file: <filename> ]
    [ key_file: <filename> ]
    
    # ServerName extension to indicate the name of the server.
    # https://tools.ietf.org/html/rfc4366#section-3.1
    [ server_name: <string> ]
    
    # Disable validation of the server certificate.
    [ insecure_skip_verify: <boolean> ]
    
    image.png

    相关文章

      网友评论

          本文标题:Prometheus 普罗米修斯监控https

          本文链接:https://www.haomeiwen.com/subject/xuuvrltx.html