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: "docker" docker_sd_configs: - host: unix:///var/run/docker.sock refresh_interval: "5s" relabel_configs: - source_labels: ['__meta_docker_container_label_com_hashicorp_nomad_alloc_id'] target_label: "alloc_id" - source_labels: ['__meta_docker_container_label_com_hashicorp_nomad_namespace'] target_label: "namespace" - source_labels: ['__meta_docker_container_label_com_hashicorp_nomad_container_name'] target_label: "container_name" - source_labels: ['__meta_docker_container_label_com_hashicorp_nomad_task_group_name'] target_label: "group" - source_labels: ['__meta_docker_container_label_com_hashicorp_nomad_task_name'] target_label: "task" pipeline_stages: - static_labels: source: nomad - match: # loki selector: '{job="loki",group=~"loki-.*"}' pipeline_name: "loki" stages: - json: expressions: message: - output: source: message - regex: expression: '^level=(?P<level>\S+) ts=(?P<time>\S+).*$' - timestamp: source: time format: "RFC3339Nano" - static_labels: filtered: "true" - match: # grafana selector: '{job="grafana",group="grafana",task="grafana"}' pipeline_name: "grafana" stages: - json: expressions: message: - output: source: message - regex: expression: '^t=(?P<time>\S+) lvl=(?P<level>\S+).*$' - timestamp: source: time format: "2006-01-02T15:04:05-0700" - static_labels: filtered: "true" - match: # patroni selector: '{job="patroni",group="patroni",task="patroni"}' pipeline_name: "patroni" stages: - multiline: firstline: '^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}' - regex: expression: '^(?P<time>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\,\d{3}).*' - timestamp: source: time format: "2006-01-02 15:04:05,999" - drop: expression: ".*INFO: no action.*" drop_counter_reason: "noise-filter" - static_labels: filtered: "true" - match: # drop selector: '{filtered!="true"}' action: drop drop_counter_reason: "nomad-filter" - labeldrop: - filtered
Обсуждают сегодня