RepositoryGo
Lifailon

Lifailon/logporter

A lightweight alternative to cAdvisor for exporting metrics from Docker containers, a log collector for sending logs to Loki, a tool for finding new image versions, and a built-in Dashboard.

104stars
11forks
0issues
4views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: docker-metrics

#1 Repository of the week

1
TINIX TRENDING·Topic: log-collector

#1 Repository of the week

1
TINIX TRENDING·Topic: cadvisor

#1 Repository of the week

logporter

Docker Hub Pulls
Docker Image Size

A simple and lightweight alternative to cAdvisor for extracting basic and custom metrics from Docker containers.

The exporter supports a metric displaying the number of logs over the scrape period. With proper logging configuration and stream separation on the application side, this metric can reflect the actual traffic volume and error rate.

Comparative measurement of CPU and memory usage from cAdvisor and logporter metrics in 3 hours:

[!NOTE] On average, CPU consumption is 15-20 times lower and memory consumption is 10 times lower in the basic metrics mode (including IOps and uptime) compared to cAdvisor.

Quick start

Clone the repository and run the pre-configured monitoring stack with a single command:

git clone https://github.com/Lifailon/logporter
cd logporter
docker-compose up -d

The dashboard and Prometheus data source with the added exporter are already connected to Grafana.

Go to Grafana UI: http://localhost:3000 and enter admin:admin.

Manual configuration

  • Build the Docker image yourself (optional):
docker build -t lifailon/logporter .
  • Run the exporter in a container using a locally built image or one published on Docker Hub:
docker run -d --name logporter \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -p 9333:9333 \
  --restart=always \
  lifailon/logporter:latest

Or use compose to securely use the docker socket through a proxy:

services:
  logporter:
    image: lifailon/logporter:latest
    container_name: logporter
    restart: always
    ports:
      - 9333:9333
    environment:
      - DOCKER_HOST=tcp://docker-proxy:2375

  docker-proxy:
    image: lscr.io/linuxserver/socket-proxy:latest
    container_name: docker-proxy
    restart: always
    environment:
      - CONTAINERS=1
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro

Use environment variables to configure the exporter:

LabelTypeDefaultDescription
DOCKER_METRICS_PORTint9333The port on which the exporter is listening.
DOCKER_METRICS_HOSTNAMEstring""A custom hostname that appears in metric tags.
DOCKER_METRICS_CACHEint15Cache time for all collected metrics in seconds.
DOCKER_METRICS_LOGbooleanfalseCollecting the number of messages in logs from all streams.
DOCKER_METRICS_LOG_CACHEint15Cache time for collected logs metrics in seconds.
DOCKER_METRICS_VOLUMEbooleantrueCollecting a list of all volumes and their sizes.
DOCKER_METRICS_VOLUME_CACHEint30Cache time for collected volumes metrics in minutes.
DOCKER_HOSTstring""Optional: use a docker proxy instead of the docker socket mount for additional security.

[!WARNING] Using custom metrics may increase resource consumption (depending on the number of containers and the logs they contain). The metrics themselves are transmitted instantly thanks to data collection by background workers and caching. Check the duration value in the exporter logs to ensure that it does not exceed the scrape interval.

  • Connect the new target to the Prometheus configuration file:
scrape_configs:
  - job_name: logporter
    scrape_interval: 15s
    scrape_timeout: 2s
    static_configs:
      - targets:
        - localhost:9333

List of metrics

NameData typeHelp description
docker_image_sizegaugeThe size of the image minus the layer shared by other images
docker_volume_sizegaugeThe size of the volumes and the number of containers associated with it in the volumeUsage tag
docker_container_statusgaugeContainer status: running (1) or stopped (0)
docker_cpu_usage_totalcounterTotal CPU usage (user and kernel) in seconds
docker_cpu_usage_usercounterUser CPU usage in seconds
docker_cpu_usage_kernelcounterKernel CPU usage in seconds
docker_memory_totalgaugeTotal memory size in bytes
docker_memory_usagegaugeUsage memory size in bytes
docker_network_received_bytescounterNumber of bytes received on the network
docker_network_received_packagescounterNumber of packages received on the network
docker_network_transmit_bytescounterNumber of bytes transmitted on the network
docker_network_transmit_packagescounterNumber of packages transmitted on the network
docker_io_read_bytescounterNumber of bytes read by the block device
docker_io_write_bytescounterNumber of bytes write by the block device
docker_process_pids_countgaugeNumber of running processes and threads
docker_logs_stdout_countcounterNumber of messages in logs from standard output
docker_logs_stderr_countcounterNumber of messages in logs from error output
docker_started_timegaugeContainer started time

Similar Projects

Discover other similar projects and AI models.

RepositoryGo
influxdata/telegraf

Agent for collecting, processing, aggregating, and writing metrics, logs, and other arbitrary data.

17.9k
Dec 1, 2026
RepositoryGo
ccfos/nightingale

Open-source, self-hosted alerting for metrics, logs, and databases. Includes a built-in AI agent and MCP server.

13.5k
Nov 30, 2026
RepositoryTypeScript
ClickHouse/ClickStack

Resolve production issues, fast. An open source observability platform unifying session replays, logs, metrics, traces and errors powered by ClickHouse and OpenTelemetry.

10.1k
Nov 27, 2026
RepositoryGo
netdata/netdata

Full-stack observability · Metrics · Logs · Traces · Flows · Topology · Infrastructure · APM · NPM · DBM · RUM · Synthetics · Cloud · AI SRE · OpenTelemetry · SNMP · NetFlow/IPFIX/sFlow · IPMI · Redfish · 2000+ integrations

81.7k
Nov 30, 2026
RepositoryGo
grafana/grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.

78.4k
Nov 30, 2026
RepositoryGo
prometheus/prometheus

The Prometheus monitoring system and time series database.

68.1k
Dec 2, 2026
RepositoryJavaScript
louislam/uptime-kuma

A fancy self-hosted monitoring tool

95.1k
Nov 30, 2026
RepositoryRust
influxdata/influxdb

Scalable datastore for metrics, events, and real-time analytics

31.8k
Dec 2, 2026
RepositoryGo
moby/moby

The Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

72.3k
Nov 26, 2026