123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- ---
- # Source: loki-stack/charts/promtail/templates/configmap.yaml
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: loki-promtail
- namespace: loki
- labels:
- app: promtail
- chart: promtail-0.13.1
- release: loki
- heritage: Tiller
- data:
- promtail.yaml: |
- client:
- backoff_config:
- maxbackoff: 5s
- maxretries: 20
- minbackoff: 100ms
- batchsize: 102400
- batchwait: 1s
- external_labels: {}
- timeout: 10s
- positions:
- filename: /run/promtail/positions.yaml
- server:
- http_listen_port: 3101
- target_config:
- sync_period: 10s
-
- scrape_configs:
- - job_name: kubernetes-pods-name
- pipeline_stages:
- - docker: {}
-
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - source_labels:
- - __meta_kubernetes_pod_label_name
- target_label: __service__
- - source_labels:
- - __meta_kubernetes_pod_node_name
- target_label: __host__
- - action: drop
- regex: ''
- source_labels:
- - __service__
- - action: labelmap
- regex: __meta_kubernetes_pod_label_(.+)
- - action: replace
- replacement: $1
- separator: /
- source_labels:
- - __meta_kubernetes_namespace
- - __service__
- target_label: job
- - action: replace
- source_labels:
- - __meta_kubernetes_namespace
- target_label: namespace
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_name
- target_label: instance
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_container_name
- target_label: container_name
- - replacement: /var/log/pods/*$1/*.log
- separator: /
- source_labels:
- - __meta_kubernetes_pod_uid
- - __meta_kubernetes_pod_container_name
- target_label: __path__
- - job_name: kubernetes-pods-app
- pipeline_stages:
- - 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:
- - __meta_kubernetes_pod_node_name
- target_label: __host__
- - action: drop
- regex: ''
- source_labels:
- - __service__
- - action: labelmap
- regex: __meta_kubernetes_pod_label_(.+)
- - action: replace
- replacement: $1
- separator: /
- source_labels:
- - __meta_kubernetes_namespace
- - __service__
- target_label: job
- - action: replace
- source_labels:
- - __meta_kubernetes_namespace
- target_label: namespace
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_name
- target_label: instance
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_container_name
- target_label: container_name
- - replacement: /var/log/pods/*$1/*.log
- separator: /
- source_labels:
- - __meta_kubernetes_pod_uid
- - __meta_kubernetes_pod_container_name
- target_label: __path__
- - job_name: kubernetes-pods-direct-controllers
- pipeline_stages:
- - docker: {}
-
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - action: drop
- regex: .+
- separator: ''
- source_labels:
- - __meta_kubernetes_pod_label_name
- - __meta_kubernetes_pod_label_app
- - action: drop
- regex: '[0-9a-z-.]+-[0-9a-f]{8,10}'
- source_labels:
- - __meta_kubernetes_pod_controller_name
- - source_labels:
- - __meta_kubernetes_pod_controller_name
- target_label: __service__
- - source_labels:
- - __meta_kubernetes_pod_node_name
- target_label: __host__
- - action: drop
- regex: ''
- source_labels:
- - __service__
- - action: labelmap
- regex: __meta_kubernetes_pod_label_(.+)
- - action: replace
- replacement: $1
- separator: /
- source_labels:
- - __meta_kubernetes_namespace
- - __service__
- target_label: job
- - action: replace
- source_labels:
- - __meta_kubernetes_namespace
- target_label: namespace
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_name
- target_label: instance
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_container_name
- target_label: container_name
- - replacement: /var/log/pods/*$1/*.log
- separator: /
- source_labels:
- - __meta_kubernetes_pod_uid
- - __meta_kubernetes_pod_container_name
- target_label: __path__
- - job_name: kubernetes-pods-indirect-controller
- pipeline_stages:
- - docker: {}
-
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - action: drop
- regex: .+
- separator: ''
- source_labels:
- - __meta_kubernetes_pod_label_name
- - __meta_kubernetes_pod_label_app
- - action: keep
- regex: '[0-9a-z-.]+-[0-9a-f]{8,10}'
- source_labels:
- - __meta_kubernetes_pod_controller_name
- - action: replace
- regex: '([0-9a-z-.]+)-[0-9a-f]{8,10}'
- source_labels:
- - __meta_kubernetes_pod_controller_name
- target_label: __service__
- - source_labels:
- - __meta_kubernetes_pod_node_name
- target_label: __host__
- - action: drop
- regex: ''
- source_labels:
- - __service__
- - action: labelmap
- regex: __meta_kubernetes_pod_label_(.+)
- - action: replace
- replacement: $1
- separator: /
- source_labels:
- - __meta_kubernetes_namespace
- - __service__
- target_label: job
- - action: replace
- source_labels:
- - __meta_kubernetes_namespace
- target_label: namespace
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_name
- target_label: instance
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_container_name
- target_label: container_name
- - replacement: /var/log/pods/*$1/*.log
- separator: /
- source_labels:
- - __meta_kubernetes_pod_uid
- - __meta_kubernetes_pod_container_name
- target_label: __path__
- - job_name: kubernetes-pods-static
- pipeline_stages:
- - docker: {}
-
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - action: drop
- regex: ''
- source_labels:
- - __meta_kubernetes_pod_annotation_kubernetes_io_config_mirror
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_label_component
- target_label: __service__
- - source_labels:
- - __meta_kubernetes_pod_node_name
- target_label: __host__
- - action: drop
- regex: ''
- source_labels:
- - __service__
- - action: labelmap
- regex: __meta_kubernetes_pod_label_(.+)
- - action: replace
- replacement: $1
- separator: /
- source_labels:
- - __meta_kubernetes_namespace
- - __service__
- target_label: job
- - action: replace
- source_labels:
- - __meta_kubernetes_namespace
- target_label: namespace
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_name
- target_label: instance
- - action: replace
- source_labels:
- - __meta_kubernetes_pod_container_name
- target_label: container_name
- - replacement: /var/log/pods/*$1/*.log
- separator: /
- source_labels:
- - __meta_kubernetes_pod_annotation_kubernetes_io_config_mirror
- - __meta_kubernetes_pod_container_name
- target_label: __path__
|