0

I'm configuring Promtail to use Consul's Service Discovery and when I put the labels to define which directory I'm going to get the logs from, I get this error when starting Promtail:

promtail[10203]: line 23: field labels not found in type consul.plain

The configuration file is this:

server:
  http_listen_port: 9080
  grpc_listen_port: 0

positions:
  filename: /tmp/positions.yaml

clients:
  - url: http://localhost:3100/loki/api/v1/push

scrape_configs:
- job_name: system
  static_configs:
  - targets:
      - localhost
    labels:
      job: varlogs
      __path__: /var/log/*log

- job_name: 'myjob'
  consul_sd_configs:
  - server: 'localhost:8500'
    labels:
      job: myjob
      __path__: /var/log/*log
  relabel_configs:
  - source_labels: ['__meta_consul_tags']
    action: keep
    regex: '.*,(myjob),.*'
    replacement: '${1}'

The error is in this line labels, does anyone know how to solve it?

Daniel Fulgido
  • 97
  • 2
  • 13

0 Answers0