scrape_configs:-job_name:dockerdocker_sd_configs:-host:unix:///var/run/docker.sockrelabel_configs:-source_labels:[__meta_docker_container_label_com_docker_compose_project]action:replacetarget_label:project-source_labels:[__meta_docker_container_name]action:replacetarget_label:container_name 1. 2....
docker_sd_configs:-host:unix:///var/run/docker.sock refresh_interval:5s filters:-name:label values:["logging=promtail"]relabel_configs:-source_labels:['__meta_docker_container_name']regex:'/(.*)'target_label:'container'-source_labels:['__meta_docker_container_log_stream']target_label:'l...
scrape_configs:-job_name:kubernetes-pods-namekubernetes_sd_configs:...pipeline_stages:# 这个阶段只有在被抓取地目标有一个标签名为 name 且值为 promtail 地时候才会执行-match:selector:'{name="promtail"}'stages:# regex 阶段解析出一个 level、timestamp 与 component,在该阶段结束时,这几个值只为 p...
- url: http://localhost:3101/loki/api/v1/push scrape_configs: - job_name: flog_scrape docker_sd_configs: - host: unix:///var/run/docker.sock refresh_interval: 5s relabel_configs: - source_labels: ['__meta_docker_container_name'] regex: '/(.*)' target_label: 'container' any ide...
- docker: {} kubernetes_sd_configs: - role: pod relabel_configs: - action: drop regex: .+ source_labels: - __meta_kubernetes_pod_label_name - source_labels: - __meta_kubernetes_pod_label_app target_label: __service__- source_labels: ...
# # 支持管道:docker、cri、regex、json、template、match、timestamp、output、labels、metrics、tenant # pipeline_stages: # - docker: {} # kubernetes_sd_configs: # - role: pod # relabel_configs: # - source_labels: # - __meta_kubernetes_pod_label_name ...
scrape_configs:- job_name: kubernetes-pods-namekubernetes_sd_configs: ...pipeline_stages:# 这个阶段只有在被抓取地目标有一个标签名为 name 且值为 promtail 地时候才会执行- match:selector: '{name="promtail"}'stages:# regex 阶段解析出一个 level、timestamp 与 component,在该阶段结束时,这几个值...
scrape_configs: -job_name:kubernetes-pods-name kubernetes_sd_configs:... pipeline_stages: # 这个阶段只有在被抓取地目标有一个标签名为 name 且值为 promtail 地时候才会执行 -match: selector:'{name="promtail"}' stages: # regex 阶段解析出一个 level、timestamp 与 component,在该阶段结束时,这几...
kubernetes_sd_configsvalueFrom:fieldRef:fieldPath:'spec.nodeName'volumeMounts:-name:logsmountPath:/var/log-name:promtail-configmountPath:/etc/promtail-mountPath:/var/lib/docker/containersname:varlibdockercontainersreadOnly:truevolumes:-name:logshostPath:path:/var/log-name:varlibdockercontainershostPath...
# 描述了如何 relabel 目标,以确定是否应该对其进行处理relabel_configs:-[<relabel_config>]# 抓取日志静态目标配置static_configs:-[<static_config>]# 包含要抓取的目标文件file_sd_configs:-[<file_sd_configs>]# 描述了如何发现在同一主机上运行的 Kubernetes 服务kubernetes_sd_configs:-[<kubernetes_sd_...