Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use __host__ label in promtail config #47

Open
james-callahan opened this issue Dec 2, 2021 · 0 comments
Open

Use __host__ label in promtail config #47

james-callahan opened this issue Dec 2, 2021 · 0 comments

Comments

@james-callahan
Copy link
Contributor

From https://grafana.com/docs/loki/latest/clients/promtail/scraping/#kubernetes-discovery

Note that while Promtail can utilize the Kubernetes API to discover pods as targets, it can only read log files from pods that are running on the same node as the one Promtail is running on. Promtail looks for a host label on each target and validates that it is set to the same hostname as Promtail's (using either $HOSTNAME or the hostname reported by the kernel if the environment variable is not set).
This means that any time Kubernetes service discovery is used, there must be a relabel_config that creates the intermediate label host from __meta_kubernetes_pod_node_name

We don't currently set the __host__ label. Though I think we still get host filtering via https://github.com/grafana/loki/blob/c53457feb95a871e7494d22c5e072004874a197c/clients/pkg/promtail/targets/file/filetargetmanager.go#L107-L117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant