美文网首页
loki发送端promtail的 docker-compose

loki发送端promtail的 docker-compose

作者: 棉花糖716 | 来源:发表于2022-11-25 22:45 被阅读0次
    version: "3"
    
    networks:
      loki:
    
    services:
      promtail:
        image: grafana/promtail:2.7.0
        restart: always
        volumes:
          - /var/log:/var/log
          - ./config/promtail-config.yml:/etc/promtail/config.yml
        command: -config.file=/etc/promtail/config.yml
        networks:
          - loki
    

    config/promtail-config.yml

    server:
      http_listen_port: 9080
      grpc_listen_port: 0
    
    positions:
      filename: /tmp/positions.yaml
    
    clients:
      - url: http://127.0.0.1:3100/loki/api/v1/push
    
    scrape_configs:
    - job_name: app
      static_configs:
      - targets:
          - localhost
        labels:
          job: app
          __path__: /var/log/app/**/*.log
    

    ps:可以把127.0.0.1 换成接收端的内网ip

    相关文章

      网友评论

          本文标题:loki发送端promtail的 docker-compose

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