grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.4k stars 3.39k forks source link

Field docker_sd_configs not found in type scrapeconfig.plain #5657

Closed sdimovv closed 2 years ago

sdimovv commented 2 years ago

Describe the bug I am using docker-compose and I am unable to limit the service discovery to containers with specific labels.

To Reproduce

networks: loki:

services: loki: image: grafana/loki:2.4.1 ports:

positions: filename: /tmp/positions.yaml

clients:

scrape_configs:

Steps to reproduce the behavior: 1.docker-compose up

  1. Observe the promtail container failing with:
    promtail_1  | Unable to parse config: /etc/promtail/promtail-config.yaml: yaml: unmarshal errors:
    promtail_1  |   line 16: field docker_sd_configs not found in type scrapeconfig.plain
    log_monitoring_example_promtail_1 exited with code 1
  2. Repeat the process but change docker_sd_configs to dockerswarm_sd_configs.
  3. Observe the promtail instance starting but complaining this is not a swarm manager
    promtail_1  | level=info ts=2022-03-17T13:42:23.283194975Z caller=server.go:260 http=[::]:9080 grpc=[::]:9095 msg="server listening on addresses"
    promtail_1  | level=info ts=2022-03-17T13:42:23.28334334Z caller=main.go:119 msg="Starting Promtail" version="(version=2.4.2, branch=HEAD, revision=525040a32)"
    promtail_1  | level=error ts=2022-03-17T13:42:23.28339124Z caller=refresh.go:79 component=discovery discovery=dockerswarm msg="Unable to refresh target groups" err="error while listing swarm services: Error response from daemon: This node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node to swarm and try again."

Expected behavior docker_sd_configs to work as described in the docs

Environment:

Screenshots, Promtail config, or terminal output N/A

dannykopping commented 2 years ago

This functionality is not available in a public release yet; it will be available as of Loki v2.5 which is coming soon.

You can use it if you use one of our daily builds: https://hub.docker.com/r/grafana/loki/tags if you like, but there may be some rough edges.

https://hub.docker.com/layers/grafana/loki/k88-c660a7e/images/sha256-3655fe08b08dbea61d1a150b28326254b1b35c9416bddab06b9aa9ee5c7c3f6c?context=explore is what we're running internally on our cloud, and has this functionality available.

sdimovv commented 2 years ago

Oh, I see. And what about promtail? Which image should I try? This one: https://hub.docker.com/layers/grafana/promtail/k88-c660a7e/images/sha256-d16b4cfb325024afd89f8bc3897fcd7e2de22e0a3b440a7b0b21a9bb2d31b6bd?context=explore ?

jeschkies commented 2 years ago

k88 should work :slightly_smiling_face:

hterik commented 2 years ago

it will be available as of Loki v2.5 which is coming soon.

Do you have any more details on what soon means here? Rough estimate like days, weeks or month would be nice :) Is there a plan or roadmap we can follow somewhere?

Also waiting for this feature, so would like to have some prediction if it's worth trying out pre-release or if we should just wait another week for an official release.