prometheus.operator.probes
prometheus.operator.probes discovers Probe resources in your Kubernetes cluster and scrapes the targets they reference.
This component performs three main functions:
- Discover Probe resources from your Kubernetes cluster.
- Discover targets or ingresses that match those Probes.
- Scrape metrics from those endpoints, and forward them to a receiver.
The default configuration assumes Alloy is running inside a Kubernetes cluster, and uses the in-cluster configuration to access the Kubernetes API.
You can run it from outside the cluster by supplying connection info in the client block, but network level access to pods is required to scrape metrics from them.
Probes may reference secrets for authenticating to targets to scrape them. In these cases, the secrets are loaded and refreshed only when the Probe is updated or when this component refreshes its’ internal state, which happens on a 5-minute refresh cycle.
Usage
prometheus.operator.probes "<LABEL>" {
forward_to = <RECEIVER_LIST>
}Arguments
You can use the following arguments with prometheus.operator.probes:
Blocks
You can use the following blocks with prometheus.operator.probes:
No valid configuration blocks found.
client
The client block configures the Kubernetes client used to discover Probes.
If the client block isn’t provided, the default in-cluster configuration with the service account of the running Alloy Pod is used.
The following arguments are supported:
At most, one of the following can be provided:
authorizationblockbasic_authblockbearer_token_fileargumentbearer_tokenargumentoauth2block
no_proxy can contain IPs, CIDR notations, and domain names. IP and domain names can contain port numbers.
proxy_url must be configured if no_proxy is configured.
proxy_from_environment uses the environment variables HTTP_PROXY, HTTPS_PROXY, and NO_PROXY (or the lowercase versions thereof).
Requests use the proxy from the environment variable matching their scheme, unless excluded by NO_PROXY.
proxy_url and no_proxy must not be configured if proxy_from_environment is configured.
proxy_connect_header should only be configured if proxy_url or proxy_from_environment are configured.
authorization
credential and credentials_file are mutually exclusive, and only one can be provided inside an authorization block.
Warning
Using
credentials_filecauses the file to be read on every outgoing request. Use thelocal.filecomponent with thecredentialsattribute instead to avoid unnecessary reads.
basic_auth
When you use password_file, the file is read on every outgoing request that uses basic authentication.
password and password_file are mutually exclusive, and only one can be provided inside a basic_auth block.
Note
High scrape or write rates create repeated file reads when you use
password_file. You can use thelocal.filecomponent to read the password file and provide the content to thepasswordattribute. This avoids repeated file reads becauselocal.filemonitors the file and reads when it changes.