V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
sewer
V2EX  ›  程序员

请教个问题。docker swarm + loki, driver 好像没效果

  •  
  •   sewer · 2022-05-12 19:13:51 +08:00 · 682 次点击
    这是一个创建于 727 天前的主题,其中的信息可能已经有所发展或是发生改变。

    按理来说 https://grafana.com/docs/loki/latest/clients/docker-driver/configuration/#labels

    下面是准备提的 issue

    Describe the bug Docker driver seems does not work. The default labels 'swarm_stack', 'swarm_service' can't find.

    To Reproduce Steps to reproduce the behavior:

    1. loki 2.2.1
    2. promtail 2.2.1
    3. grafana:7.5.15
    4. driver: latest

    Environment:

    • Infrastructure: Docker Swarm
    • Deployment tool: stack
    • OS: Manjaro

    compose file

    x-logging: &loki-logging
      driver: loki:latest
      options:
        loki-url: 'http://loki:3100/loki/api/v1/push'
        max-size: '300m'
    
    

    promtail.yaml

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

    loki.yaml

    
    auth_enabled: false
    
    server:
      http_listen_port: 3100
    
    ingester:
      lifecycler:
        address: 127.0.0.1
        ring:
          kvstore:
            store: inmemory
          replication_factor: 1
        final_sleep: 0s
      chunk_idle_period: 1h # Any chunk not receiving new logs in this time will be flushed
      max_chunk_age: 1h # All chunks will be flushed when they hit this age, default is 1h
      chunk_target_size: 1048576 # Loki will attempt to build chunks up to 1.5MB, flushing first if chunk_idle_period or max_chunk_age is reached first
      chunk_retain_period: 30s # Must be greater than index read cache TTL if using an index cache (Default index read cache TTL is 5m)
      max_transfer_retries: 0 # Chunk transfers disabled
    
    schema_config:
      configs:
        - from: 2020-10-24
          store: boltdb-shipper
          object_store: filesystem
          schema: v11
          index:
            prefix: index_
            period: 24h
    
    storage_config:
      boltdb_shipper:
        active_index_directory: /loki/boltdb-shipper-active
        cache_location: /loki/boltdb-shipper-cache
        cache_ttl: 24h # Can be increased for faster performance over longer query periods, uses more disk space
        shared_store: filesystem
      filesystem:
        directory: /loki/chunks
    
    compactor:
      working_directory: /loki/boltdb-shipper-compactor
      shared_store: filesystem
    
    limits_config:
      reject_old_samples: true
      reject_old_samples_max_age: 168h
    
    chunk_store_config:
      max_look_back_period: 0s
    
    table_manager:
      retention_deletes_enabled: false
      retention_period: 0s
    
    ruler:
      storage:
        type: local
        local:
          directory: /loki/rules
      rule_path: /loki/rules-temp
      alertmanager_url: http://localhost:9093
      ring:
        kvstore:
          store: inmemory
      enable_api: true
    

    Screenshots, Promtail config, or terminal output image

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5570 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 08:22 · PVG 16:22 · LAX 01:22 · JFK 04:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.