
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
github.com/davidborzek/docker-exporter
Advanced tools
Simple and lightweight Prometheus exporter for docker container metrics.
The exporter is available as a Docker image. You can run it using the following example:
$ docker run \
-u root \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 8080:8080 \
ghcr.io/davidborzek/docker-exporter:latest
Note: To run Docker Exporter, you'll need to mount the Docker socket from your host system. This operation necessitates root privileges or the user running the command to be a member of the Docker group. It's important to note that mounting the Docker socket grants the container unrestricted access to Docker. For a more secure approach, consider utilizing the Docker Socket Proxy, which is further explained below for additional information.
$ docker run \
-e "DOCKER_HOST=tcp://localhost:2375" \
-p 8080:8080 \
ghcr.io/davidborzek/docker-exporter:latest
Note: the docker-socket-proxy needs to have container access enabled. (
CONTAINERS=1)
Once you have configured the exporter, update your prometheus.yml scrape config:
scrape_configs:
- job_name: "docker_exporter"
static_configs:
- targets: ["localhost:8080"]
| Flag | Description | Default Value | Environment Variable |
|---|---|---|---|
--port | The port of docker exporter server. | 8080 | DOCKER_EXPORTER_PORT |
--host | The host of docker exporter server. | DOCKER_EXPORTER_HOST | |
--auth-token | Optional auth token for the docker exporter server. If no token is set authentication is disabled. | DOCKER_EXPORTER_AUTH_TOKEN | |
--log-level | Log level for the exporter. | info | DOCKER_EXPORTER_LOG_LEVEL |
--ignore-label | Set the label name for ignoring docker containers. (See Ignoring Containers) | docker-exporter.ignore | DOCKER_EXPORTER_IGNORE_LABEL |
| Metric Name | Description | Labels |
|---|---|---|
| docker_container_block_io_read_bytes | Block I/O read bytes total | name |
| docker_container_block_io_write_bytes | Block I/O write bytes total | name |
| docker_container_cpu_usage_percentage | CPU usage in percentage | name |
| docker_container_info | Infos about the container | name, image_name, image |
| docker_container_memory_total_bytes | Total memory in bytes | name |
| docker_container_memory_usage_bytes | Memory usage in bytes | name |
| docker_container_memory_usage_percentage | Memory usage in percentage | name |
| docker_container_network_rx_bytes | Network received bytes total | name, network |
| docker_container_network_rx_dropped_packets | Network dropped packets total | name, network |
| docker_container_network_rx_errors | Network received errors | name, network |
| docker_container_network_rx_packets | Network received packets total | name, network |
| docker_container_network_tx_bytes | Network sent bytes total | name, network |
| docker_container_network_tx_dropped_packets | Network dropped packets total | name, network |
| docker_container_network_tx_errors | Network sent errors | name, network |
| docker_container_network_tx_packets | Network sent packets total | name, network |
| docker_container_pids_current | Current number of pids | name |
| docker_container_state | State of the container | name, state |
| docker_container_uptime | Uptime of the container in seconds | name |
| docker_exporter_scrape_duration | Duration of the scrape in seconds | |
| docker_exporter_scrape_errors | Number of scrape errors |
You can ignore containers by setting the label docker-exporter.ignore on the container. The label name can be configured with the --ignore-label flag.
services:
nginx:
image: nginx
labels:
docker-exporter.ignore: "true"
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.