Skip to content

Commit

Permalink
promtail
Browse files Browse the repository at this point in the history
  • Loading branch information
mrpbennett committed Jul 16, 2024
1 parent 847f58c commit ff3e7b4
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 43 deletions.
2 changes: 1 addition & 1 deletion kubernetes/apps/homepage-dashboard/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ data:
- Loki:
icon: loki.png
href: http://loki.pnfb.home
href: http://192.168.5.62:3100/metrics
description: Fully featured logging stack
target: _blank
Expand Down
64 changes: 22 additions & 42 deletions kubernetes/apps/monitoring/promtail/config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,29 @@ data:
promtail.yaml: |
server:
http_listen_port: 9080
grpc_listen_port: 0
grpc_listen_port: 9095
positions:
filename: /var/log/positions.yaml
clients:
- url: http://loki-svc:3100/loki/api/v1/push
- url: http://loki-svc:3100/loki/api/v1/push
positions:
filename: /tmp/positions.yaml
target_config:
sync_period: 10s
scrape_configs:
- job_name: pod-logs
kubernetes_sd_configs:
- role: pod
pipeline_stages:
- docker: {}
relabel_configs:
- source_labels:
- __meta_kubernetes_pod_node_name
target_label: __host__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- action: replace
replacement: $1
separator: /
source_labels:
- __meta_kubernetes_namespace
- __meta_kubernetes_pod_name
target_label: job
- action: replace
source_labels:
- __meta_kubernetes_namespace
target_label: namespace
- action: replace
source_labels:
- __meta_kubernetes_pod_name
target_label: pod
- action: replace
source_labels:
- __meta_kubernetes_pod_container_name
target_label: container
- 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
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_label_name]
target_label: job
- source_labels: [__meta_kubernetes_namespace]
target_label: namespace
- source_labels: [__meta_kubernetes_pod_name]
target_label: pod
pipeline_stages:
- docker: {}
static_configs:
- targets: ['localhost']
labels:
job: kubernetes-pods
__path__: /var/log/pods/*/*/*.log

0 comments on commit ff3e7b4

Please sign in to comment.