prometheus.exporter.cadvisor
The prometheus.exporter.cadvisor
component collects container metrics using cAdvisor.
Usage
prometheus.exporter.cadvisor "<LABEL>" {
}
Arguments
You can use the following arguments with prometheus.exporter.cadvisor
:
For allowlisted_container_labels
to take effect, store_container_labels
must be set to false
.
env_metadata_allowlist
is only supported for containerd and Docker runtimes.
If perf_events_config
is not set, measurement of perf
events is disabled.
A resctrl_interval
of 0
disables updating mon groups.
The values for enabled_metrics
and disabled_metrics
don’t correspond to Prometheus metrics, but to kinds of metrics that should or shouldn’t be exposed.
The values that you can use are:
"advtcp"
"app"
"cpu_topology"
"cpu"
"cpuLoad"
"cpuset"
"disk"
"diskIO"
"hugetlb"
"memory_numa"
"memory"
"network"
"oom_event"
"percpu"
"perf_event"
"process"
"referenced_memory"
"resctrl"
"sched"
"tcp"
"udp"
By default the following metric kinds are disabled:
"advtcp"
"cpu_topology"
"cpuset"
"hugetlb"
"memory_numa"
"process"
"referenced_memory"
"resctrl"
"tcp"
"udp"
Blocks
The prometheus.exporter.cadvisor
component doesn’t support any blocks. You can configure this component with arguments.
Exported fields
The following fields are exported and can be referenced by other components.
For example, the targets
can either be passed to a discovery.relabel
component to rewrite the targets’ label sets or to a prometheus.scrape
component that collects the exposed metrics.
The exported targets use the configured in-memory traffic address specified by the run command.
Component health
prometheus.exporter.cadvisor
is only reported as unhealthy if given an invalid configuration.
In those cases, exported fields retain their last healthy values.
Debug information
prometheus.exporter.cadvisor
doesn’t expose any component-specific debug information.
Debug metrics
prometheus.exporter.cadvisor
doesn’t expose any component-specific debug metrics.
Example
This example uses a prometheus.scrape
component to collect metrics from prometheus.exporter.cadvisor
:
prometheus.exporter.cadvisor "example" {
docker_host = "unix:///var/run/docker.sock"
storage_duration = "5m"
}
// Configure a prometheus.scrape component to collect cadvisor metrics.
prometheus.scrape "scraper" {
targets = prometheus.exporter.cadvisor.example.targets
forward_to = [ prometheus.remote_write.demo.receiver ]
}
prometheus.remote_write "demo" {
endpoint {
url = "<PROMETHEUS_REMOTE_WRITE_URL>"
basic_auth {
username = "<USERNAME>"
password = "<PASSWORD>"
}
}
}
Replace the following:
<PROMETHEUS_REMOTE_WRITE_URL>
: The URL of the Prometheusremote_write
compatible server to send metrics to.<USERNAME>
: The username to use for authentication to theremote_write
API.<PASSWORD>
: The password to use for authentication to theremote_write
API.
Compatible components
prometheus.exporter.cadvisor
has exports that can be consumed by the following components:
- Components that consume Targets
Note
Connecting some components may not be sensible or components may require further configuration to make the connection work correctly. Refer to the linked documentation for more details.