configmap.yaml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. ---
  2. # Source: loki-stack/charts/promtail/templates/configmap.yaml
  3. apiVersion: v1
  4. kind: ConfigMap
  5. metadata:
  6. name: loki-promtail
  7. namespace: loki
  8. labels:
  9. app: promtail
  10. chart: promtail-0.13.1
  11. release: loki
  12. heritage: Tiller
  13. data:
  14. promtail.yaml: |
  15. client:
  16. backoff_config:
  17. maxbackoff: 5s
  18. maxretries: 20
  19. minbackoff: 100ms
  20. batchsize: 102400
  21. batchwait: 1s
  22. external_labels: {}
  23. timeout: 10s
  24. positions:
  25. filename: /run/promtail/positions.yaml
  26. server:
  27. http_listen_port: 3101
  28. target_config:
  29. sync_period: 10s
  30. scrape_configs:
  31. - job_name: kubernetes-pods-name
  32. pipeline_stages:
  33. - docker: {}
  34. kubernetes_sd_configs:
  35. - role: pod
  36. relabel_configs:
  37. - source_labels:
  38. - __meta_kubernetes_pod_label_name
  39. target_label: __service__
  40. - source_labels:
  41. - __meta_kubernetes_pod_node_name
  42. target_label: __host__
  43. - action: drop
  44. regex: ''
  45. source_labels:
  46. - __service__
  47. - action: labelmap
  48. regex: __meta_kubernetes_pod_label_(.+)
  49. - action: replace
  50. replacement: $1
  51. separator: /
  52. source_labels:
  53. - __meta_kubernetes_namespace
  54. - __service__
  55. target_label: job
  56. - action: replace
  57. source_labels:
  58. - __meta_kubernetes_namespace
  59. target_label: namespace
  60. - action: replace
  61. source_labels:
  62. - __meta_kubernetes_pod_name
  63. target_label: instance
  64. - action: replace
  65. source_labels:
  66. - __meta_kubernetes_pod_container_name
  67. target_label: container_name
  68. - replacement: /var/log/pods/*$1/*.log
  69. separator: /
  70. source_labels:
  71. - __meta_kubernetes_pod_uid
  72. - __meta_kubernetes_pod_container_name
  73. target_label: __path__
  74. - job_name: kubernetes-pods-app
  75. pipeline_stages:
  76. - docker: {}
  77. kubernetes_sd_configs:
  78. - role: pod
  79. relabel_configs:
  80. - action: drop
  81. regex: .+
  82. source_labels:
  83. - __meta_kubernetes_pod_label_name
  84. - source_labels:
  85. - __meta_kubernetes_pod_label_app
  86. target_label: __service__
  87. - source_labels:
  88. - __meta_kubernetes_pod_node_name
  89. target_label: __host__
  90. - action: drop
  91. regex: ''
  92. source_labels:
  93. - __service__
  94. - action: labelmap
  95. regex: __meta_kubernetes_pod_label_(.+)
  96. - action: replace
  97. replacement: $1
  98. separator: /
  99. source_labels:
  100. - __meta_kubernetes_namespace
  101. - __service__
  102. target_label: job
  103. - action: replace
  104. source_labels:
  105. - __meta_kubernetes_namespace
  106. target_label: namespace
  107. - action: replace
  108. source_labels:
  109. - __meta_kubernetes_pod_name
  110. target_label: instance
  111. - action: replace
  112. source_labels:
  113. - __meta_kubernetes_pod_container_name
  114. target_label: container_name
  115. - replacement: /var/log/pods/*$1/*.log
  116. separator: /
  117. source_labels:
  118. - __meta_kubernetes_pod_uid
  119. - __meta_kubernetes_pod_container_name
  120. target_label: __path__
  121. - job_name: kubernetes-pods-direct-controllers
  122. pipeline_stages:
  123. - docker: {}
  124. kubernetes_sd_configs:
  125. - role: pod
  126. relabel_configs:
  127. - action: drop
  128. regex: .+
  129. separator: ''
  130. source_labels:
  131. - __meta_kubernetes_pod_label_name
  132. - __meta_kubernetes_pod_label_app
  133. - action: drop
  134. regex: '[0-9a-z-.]+-[0-9a-f]{8,10}'
  135. source_labels:
  136. - __meta_kubernetes_pod_controller_name
  137. - source_labels:
  138. - __meta_kubernetes_pod_controller_name
  139. target_label: __service__
  140. - source_labels:
  141. - __meta_kubernetes_pod_node_name
  142. target_label: __host__
  143. - action: drop
  144. regex: ''
  145. source_labels:
  146. - __service__
  147. - action: labelmap
  148. regex: __meta_kubernetes_pod_label_(.+)
  149. - action: replace
  150. replacement: $1
  151. separator: /
  152. source_labels:
  153. - __meta_kubernetes_namespace
  154. - __service__
  155. target_label: job
  156. - action: replace
  157. source_labels:
  158. - __meta_kubernetes_namespace
  159. target_label: namespace
  160. - action: replace
  161. source_labels:
  162. - __meta_kubernetes_pod_name
  163. target_label: instance
  164. - action: replace
  165. source_labels:
  166. - __meta_kubernetes_pod_container_name
  167. target_label: container_name
  168. - replacement: /var/log/pods/*$1/*.log
  169. separator: /
  170. source_labels:
  171. - __meta_kubernetes_pod_uid
  172. - __meta_kubernetes_pod_container_name
  173. target_label: __path__
  174. - job_name: kubernetes-pods-indirect-controller
  175. pipeline_stages:
  176. - docker: {}
  177. kubernetes_sd_configs:
  178. - role: pod
  179. relabel_configs:
  180. - action: drop
  181. regex: .+
  182. separator: ''
  183. source_labels:
  184. - __meta_kubernetes_pod_label_name
  185. - __meta_kubernetes_pod_label_app
  186. - action: keep
  187. regex: '[0-9a-z-.]+-[0-9a-f]{8,10}'
  188. source_labels:
  189. - __meta_kubernetes_pod_controller_name
  190. - action: replace
  191. regex: '([0-9a-z-.]+)-[0-9a-f]{8,10}'
  192. source_labels:
  193. - __meta_kubernetes_pod_controller_name
  194. target_label: __service__
  195. - source_labels:
  196. - __meta_kubernetes_pod_node_name
  197. target_label: __host__
  198. - action: drop
  199. regex: ''
  200. source_labels:
  201. - __service__
  202. - action: labelmap
  203. regex: __meta_kubernetes_pod_label_(.+)
  204. - action: replace
  205. replacement: $1
  206. separator: /
  207. source_labels:
  208. - __meta_kubernetes_namespace
  209. - __service__
  210. target_label: job
  211. - action: replace
  212. source_labels:
  213. - __meta_kubernetes_namespace
  214. target_label: namespace
  215. - action: replace
  216. source_labels:
  217. - __meta_kubernetes_pod_name
  218. target_label: instance
  219. - action: replace
  220. source_labels:
  221. - __meta_kubernetes_pod_container_name
  222. target_label: container_name
  223. - replacement: /var/log/pods/*$1/*.log
  224. separator: /
  225. source_labels:
  226. - __meta_kubernetes_pod_uid
  227. - __meta_kubernetes_pod_container_name
  228. target_label: __path__
  229. - job_name: kubernetes-pods-static
  230. pipeline_stages:
  231. - docker: {}
  232. kubernetes_sd_configs:
  233. - role: pod
  234. relabel_configs:
  235. - action: drop
  236. regex: ''
  237. source_labels:
  238. - __meta_kubernetes_pod_annotation_kubernetes_io_config_mirror
  239. - action: replace
  240. source_labels:
  241. - __meta_kubernetes_pod_label_component
  242. target_label: __service__
  243. - source_labels:
  244. - __meta_kubernetes_pod_node_name
  245. target_label: __host__
  246. - action: drop
  247. regex: ''
  248. source_labels:
  249. - __service__
  250. - action: labelmap
  251. regex: __meta_kubernetes_pod_label_(.+)
  252. - action: replace
  253. replacement: $1
  254. separator: /
  255. source_labels:
  256. - __meta_kubernetes_namespace
  257. - __service__
  258. target_label: job
  259. - action: replace
  260. source_labels:
  261. - __meta_kubernetes_namespace
  262. target_label: namespace
  263. - action: replace
  264. source_labels:
  265. - __meta_kubernetes_pod_name
  266. target_label: instance
  267. - action: replace
  268. source_labels:
  269. - __meta_kubernetes_pod_container_name
  270. target_label: container_name
  271. - replacement: /var/log/pods/*$1/*.log
  272. separator: /
  273. source_labels:
  274. - __meta_kubernetes_pod_annotation_kubernetes_io_config_mirror
  275. - __meta_kubernetes_pod_container_name
  276. target_label: __path__