README ¶
podman_exporter
Prometheus exporter for podman environment exposing containers, pods, images, volumes and networks informations.
podman_exporter uses the podman v3.x (libpod) library to fetch the statistics and not rest api (no need to enable podman.socket service).
Simple Grafana dashboard is also available.
Installation and Usage
podman_exporter is using go v1.17 or above.
-
Clone the repo
-
Build and run the executable
$ make build $ ./bin/podman_exporter
By default only container collector is enabled, in order to enable all collectors use --collector.enable-all
or use --collector.enable-<name>
flag to enable other collector.
Example:
enable all available collectors:
$ ./bin/podman_exporter --collector.enable-all
Collectors
The table below list all existing collector and their description.
Name | Description |
---|---|
container | exposes containers information |
image | exposes images information |
network | exposes networks information |
pod | exposes pod information |
volume | exposes volume information |
system | exposes system (host) information |
Collectors examples output
container
# HELP podman_container_block_input Container block input.
# TYPE podman_container_block_input gauge
podman_container_block_input{id="468d979d6d16",name="prometheus"} 131072
podman_container_block_input{id="ad82eb546465",name="grafana"} 3.506176e+06
# HELP podman_container_block_output Container block output.
# TYPE podman_container_block_output gauge
podman_container_block_output{id="468d979d6d16",name="prometheus"} 1.97619712e+08
podman_container_block_output{id="ad82eb546465",name="grafana"} 9.6608256e+07
# HELP podman_container_cpu Container cpu usage (percentage).
# TYPE podman_container_cpu gauge
podman_container_cpu{id="468d979d6d16",name="prometheus"} 1.3317095987369393e-05
podman_container_cpu{id="ad82eb546465",name="grafana"} 4.514656376534937e-06
# HELP podman_container_info Container information.
# TYPE podman_container_info gauge
podman_container_info{created="15 hours ago",id="468d979d6d16",image="docker.io/prom/prometheus:latest",name="prometheus",pod_id="dcc119804baf",ports="0.0.0.0:9090->9090/tcp"} 1
podman_container_info{created="16 hours ago",id="ad82eb546465",image="docker.io/grafana/grafana-enterprise:latest",name="grafana",pod_id="dcc119804baf",ports="0.0.0.0:3000->3000/tcp"} 1
# HELP podman_container_mem_limit Container memory limit.
# TYPE podman_container_mem_limit gauge
podman_container_mem_limit{id="468d979d6d16",name="prometheus"} 1.669076992e+10
podman_container_mem_limit{id="ad82eb546465",name="grafana"} 1.669076992e+10
# HELP podman_container_mem_perc Container memory usage (percentage).
# TYPE podman_container_mem_perc gauge
podman_container_mem_perc{id="468d979d6d16",name="prometheus"} 0.47716566929945436
podman_container_mem_perc{id="ad82eb546465",name="grafana"} 0.21477854030594654
# HELP podman_container_mem_usage Container memory usage.
# TYPE podman_container_mem_usage gauge
podman_container_mem_usage{id="468d979d6d16",name="prometheus"} 7.9642624e+07
podman_container_mem_usage{id="ad82eb546465",name="grafana"} 3.5848192e+07
# HELP podman_container_net_input Container network input.
# TYPE podman_container_net_input gauge
podman_container_net_input{id="468d979d6d16",name="prometheus"} 1.2718031e+07
podman_container_net_input{id="ad82eb546465",name="grafana"} 3.2426071e+07
# HELP podman_container_net_output Container network output.
# TYPE podman_container_net_output gauge
podman_container_net_output{id="468d979d6d16",name="prometheus"} 8.003195e+06
podman_container_net_output{id="ad82eb546465",name="grafana"} 3.608516e+06
# HELP podman_container_pids Container pid number.
# TYPE podman_container_pids gauge
podman_container_pids{id="468d979d6d16",name="prometheus"} 14
podman_container_pids{id="ad82eb546465",name="grafana"} 14
# HELP podman_container_state Container current state (-1=unknown,0=exited/stopped,1=running,2=created).
# TYPE podman_container_state gauge
podman_container_state{id="468d979d6d16",name="prometheus"} 1
podman_container_state{id="ad82eb546465",name="grafana"} 1
# HELP podman_container_total Total number of containers.
# TYPE podman_container_total gauge
podman_container_total 2
pod
# HELP podman_pod_containers_total Number of containers in a pod.
# TYPE podman_pod_containers_total gauge
podman_pod_containers_total{id="dcc119804baf",name="pod_test01"} 1
# HELP podman_pod_info Pod information
# TYPE podman_pod_info gauge
podman_pod_info{created="7 days ago",id="dcc119804baf",infra_id="b0e4ec28634b",name="pod_test01"} 1
# HELP podman_pod_state Pods current state current state (-1=unknown,0=exited/stopped,1=running,2=created).
# TYPE podman_pod_state gauge
podman_pod_state{id="dcc119804baf",name="pod_test01"} 0
# HELP podman_pod_total Total number of pods.
# TYPE podman_pod_total gauge
podman_pod_total 1
image
# HELP podman_image_info Image information.
# TYPE podman_image_info gauge
podman_image_info{created="2 weeks ago",id="a3d385fc29f9",repository="docker.io/prom/prometheus",tag="latest"} 1
podman_image_info{created="3 weeks ago",id="57a82e48a26b",repository="docker.io/grafana/grafana-enterprise",tag="latest"} 1
# HELP podman_image_size Image size
# TYPE podman_image_size gauge
podman_image_size{id="a3d385fc29f9",repository="docker.io/prom/prometheus"} 2.02275311e+08
podman_image_size{id="57a82e48a26b",repository="docker.io/grafana/grafana-enterprise"} 3.12937712e+08
# HELP podman_image_total Total number of images.
# TYPE podman_image_total gauge
podman_image_total 2
network
# HELP podman_network_info Network information.
# TYPE podman_network_info gauge
podman_network_info{labels="",name="podman",plugins="bridge,portmap,firewall,tuning",version="0.4.0"} 1
# HELP podman_network_total Total number of networks.
# TYPE podman_network_total gauge
podman_network_total 1
volume
# HELP podman_volume_info Volume information.
# TYPE podman_volume_info gauge
podman_volume_info{created="7 days ago",driver="local",mount_point="/storage/volumes/vol_data01/_data",name="vol_data01"} 1
# HELP podman_volume_total Total number of volumes.
# TYPE podman_volume_total gauge
podman_volume_total 1
system
# HELP podman_system_api_version Podman system api version.
# TYPE podman_system_api_version gauge
podman_system_api_version{version="3.4.4"} 1
# HELP podman_system_buildah_version Podman system buildahVer version.
# TYPE podman_system_buildah_version gauge
podman_system_buildah_version{version="1.23.1"} 1
# HELP podman_system_conmon_version Podman system conmon version.
# TYPE podman_system_conmon_version gauge
podman_system_conmon_version{version="conmon version 2.0.27"} 1
# HELP podman_system_runtime_version Podman system runtime version.
# TYPE podman_system_runtime_version gauge
podman_system_runtime_version{version="crun version 0.19.1"} 1
# HELP podman_system_cpus Podman system (host) total number of cpus.
# TYPE podman_system_cpus gauge
podman_system_cpus 8
# HELP podman_system_memory_free Podman system (host) total free memory size.
# TYPE podman_system_memory_free gauge
podman_system_memory_free 9.87480064e+08
# HELP podman_system_memory_total Podman system (host) total memory size.
# TYPE podman_system_memory_total gauge
podman_system_memory_total 1.669076992e+10
# HELP podman_system_swap_free Podman system (host) total free swap size.
# TYPE podman_system_swap_free gauge
podman_system_swap_free 7.636250624e+09
# HELP podman_system_swap_total Podman system (host) total swap size.
# TYPE podman_system_swap_total gauge
podman_system_swap_total 8.589930496e+09
Documentation ¶
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.