You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, the promtail config that is exposed to the user requires knowledge about how Prometheus is configured. This is due to the fact that promtail's service discovery uses the same service discovery code as Prometheus.
While this is good for code re-use, it doesn't account for how the Prometheus service discovery can discover other machines, while promtail only supports reading from the current host. This leaves filtering out the other machines as an exercise to the operator in the relabel_configs section of the scrape_config.
The following would make it easier to configure promtail and understand:
Expose only the subset of service discovery methods that work with Promtail. static_config, kubernetes_sd_config, and file_sd_config are the only service discovery mechanisms that I believe work today.
When appropriate (i.e., kubernetes_sd_config), wrap the underlying Prometheus service discovery mechanism with a filter to remove any node that is not the same host that promtail is running on.
This should be implemented in a backwards-compatible way: any existing relabel_config that adds the __host__ label to the Kubernetes SD discovery should continue to work.
I'm not aware of any at the moment, but other boilerplate that all users need to do for kubernetes_sd_config to work should be abstracted out and removed as a requirement.
This issue has been automatically marked as stale because it has not had any activity in the past 30 days. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
stalebot
added
the
stale
A stale issue or PR that will automatically be closed.
label
Mar 29, 2020
Today, the promtail config that is exposed to the user requires knowledge about how Prometheus is configured. This is due to the fact that promtail's service discovery uses the same service discovery code as Prometheus.
While this is good for code re-use, it doesn't account for how the Prometheus service discovery can discover other machines, while promtail only supports reading from the current host. This leaves filtering out the other machines as an exercise to the operator in the
relabel_configs
section of thescrape_config
.The following would make it easier to configure promtail and understand:
static_config
,kubernetes_sd_config
, andfile_sd_config
are the only service discovery mechanisms that I believe work today.kubernetes_sd_config
), wrap the underlying Prometheus service discovery mechanism with a filter to remove any node that is not the same host that promtail is running on.This should be implemented in a backwards-compatible way: any existing relabel_config that adds the
__host__
label to the Kubernetes SD discovery should continue to work.I'm not aware of any at the moment, but other boilerplate that all users need to do for
kubernetes_sd_config
to work should be abstracted out and removed as a requirement.Related to #820.
The text was updated successfully, but these errors were encountered: