Logzio Metrics Collector
Container
Docker Metrics Collector is a container that runs Metricbeat with the modules you enable at runtime.
Image details
Source details
Configuration
TypeContainerlogzio/docker-collector-metricsYes/var/run/docker.sock : /var/run/docker.sock/hostfs/sys/fs/cgroup : /sys/fs/cgroup/hostfs/proc : /proc/hostfs : /LOGZIO_TOKEN=REPLACE-LOGZIO-TOKEN-HERELOGZIO_MODULES=system,dockerTemplate by mediadepot
Standalone Install
Select an install method, to see config/commands for deploying Logzio Metrics Collector
Install on Portainer
Import all app templates into your Portainer instance, for easy 1-click deploys
- Ensure both Docker and Portainer are installed, and up-to-date
- Log into your Portainer web UI
- Under Settings → App Templates, paste the below URL
- Head to Home → App Templates, and the list of apps will show up
- Select Logzio Metrics Collector, fill in any config options, and hit Deploy
Template Import URL
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me
More install options in our documentation, or see logzio/docker-collector-metrics for app-specific guidance.
docker-collector-metrics
docker-collector-metrics is a Docker container that uses Metricbeat to collect metrics and forward those metrics to your Logz.io account.To use this container, you'll set environment variables in your docker run command. docker-collector-metrics uses those environment variables to specify which Metricbeat modules you want to be collected. docker-collector-metrics mounts docker.sock to the container itself, allowing Metricbeat to collect the metrics and metadata.
docker-collector-metrics ships metrics only. If you want to ship logs to Logz.io, see docker-collector-logs.
docker-collector-metrics setup
- Pull the Docker image
Download the logzio/docker-collector-metrics image:docker pull logzio/docker-collector-metrics- Run the container
For a complete list of options, see the parameters below the code block.👇docker run --name docker-collector-metrics \
--env LOGZIO_TOKEN="<ACCOUNT-TOKEN>" \
--env LOGZIO_URL="<LISTENER-URL>" \
--env LOGZIO_MODULES="<COLLECTED-MODULES>" \
logzio/docker-collector-metricsParameters
| Parameter | Description |
|---|---|
| LOGZIOTOKEN | Required. Your Logz.io account token. Replace <ACCOUNT-TOKEN> with the token of the account you want to ship to. |
| LOGZIOURL | Default: listener.logz.io Logz.io listener URL to ship the metrics to. For more information on finding your account's region, see Account region. |
| LOGZIOTYPE | Default: docker-collector-metrics Logz.io type you'll use with this Docker. This is shown in your logs under the type field in Kibana. Logz.io applies parsing based on type. |
| LOGZIOLOGLEVEL | Default: "INFO" The log level the scripts will use |
| LOGZIOMODULES | Required The Meatricbeat modules we will use for this container separated by ',' delimiter, formatted as "module1,module2,module3". Current we support these modules: system, docker If you specify the docker module, you'll have to mounts docker.sock to the container itself by adding -v /var/run/docker.sock:/var/run/docker.sock:ro to the run command. If you want to use your custom module configurations or use modules that we are yet to support, you need to mount the module files to /logzio/modules |
| LOGZIOADDITIONALFIELDS | include additional fields with every message sent, formatted as "fieldName1=fieldValue1;fieldName2=fieldValue2". To use an environment variable, format as "fieldName1=fieldValue1;fieldName2=$ENVVARNAME". In that case, the environment variable should be the only value in the field. If the environment variable can’t be resolved, the field is omitted. |
- Check Logz.io for your metrics
Run the docker. Give your metrics a few minutes to get from your system to ours, and then open Kibana.Change log
- 0.0.4:- Refactor the image to use default Metricbeat yamls. - 0.0.3: BREAKING CHANGES:- using beats7
- supporting multiple modules - 0.0.2: added the ability to set the type to fetched metrics.Check the logs first
Nine times out of ten the logs tell you exactly what went wrong.
- In Portainer, go to Containers, click the container, then Logs. Or run
docker logs logzio-metrics-collector - Exit codes help too:
137means killed, usually out of memory.126or127means the command inside the image is broken.
Permission denied on volumes
If the logs show "permission denied", the app can't write to its data folder on the host.
- Seeing "read-only file system"?
/sys/fs/cgroupis mounted read-only on purpose, the app isn't meant to write there.
Can't reach the Docker socket
logzio-metrics-collector talks to Docker through /var/run/docker.sock. If the logs show
"permission denied while trying to connect to the Docker daemon socket", the app's user can't access it.
- Check the socket exists on the host:
ls -l /var/run/docker.sock - Run the container as root, or add the docker group's id to the container with
group_add.
Image won't pull
Test the pull directly on the host: docker pull logzio/docker-collector-metrics
- "manifest unknown" means the tag no longer exists. This template uses
latest, so try pinning a specific version instead. - "toomanyrequests" is the Docker Hub rate limit. Log in with
docker loginto raise it. - "no space left on device" means a full disk. Reclaim space with
docker system prune
"exec format error"
This means the image was built for a different CPU architecture than your server.
- This image supports:
amd64 - Check yours with
uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.
Privileged mode
This template runs the container in privileged mode, giving it full access to your host.
- Only deploy it if you trust the app.
- If deployment is blocked, your Portainer security settings or hardened host may not allow privileged containers.
Upstream project is archived
The developers have archived logzio/docker-collector-metrics, so bugs and security issues won't be fixed.
- It'll keep working for now, but consider the similar apps below for a maintained alternative.
Raise an issue
Found something which isn't working as it should? Here's how to report it.
- Bug within the app: Open an issue on logzio/docker-collector-metrics
- Template not working: Open an issue on mediadepot/templates
- This website not working: Open an issue on lissy93/portainer-templates
A single container
Logzio Metrics Collector runs as one container, the simplest kind of app here. Just the one image to pull and nothing else wired up alongside it.
The app image
An image is the app packed up ready to go, everything Logzio Metrics Collector needs bundled into one download. This template pulls logzio/docker-collector-metrics, which Docker fetches once (about 99 MB) and then starts your own copy from.
Where the image comes from
Docker pulls its images from registries, public libraries of ready-built apps. Logzio Metrics Collector's comes from Docker Hub, published by logzio.
Version tags
The bit after the colon in the image name is the version tag. Here it's latest, which always points at the newest build, so a redeploy can bump you to a newer release without you asking. Newest right now is 0.2.1. Pin a specific tag if you would rather stay on one version.
Which machines it runs on
Every image is built for particular CPU types. This one ships for amd64, so it runs on regular x86 PCs and servers, though not ARM boards like a Raspberry Pi.
Volumes
A volume is where Logzio Metrics Collector keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:
/var/run/docker.sockfrom/var/run/docker.sockon the host, read-only (a socket it talks to, not storage)/hostfs/sys/fs/cgroupfrom/sys/fs/cgroupon the host, read-only/hostfs/procfrom/procon the host, read-only/hostfsfrom/on the host, read-only
Environment variables
Environment variables are the settings you hand over when you deploy, things like a password or a timezone. Logzio Metrics Collector takes 2 of them, all with defaults you can leave alone or tweak:
LOGZIO_TOKEN, defaults toREPLACE-LOGZIO-TOKEN-HERELOGZIO_MODULES, defaults tosystem,docker
Networking
Nothing custom is set, so Logzio Metrics Collector sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.
Container name
Once it's deployed, Portainer names the container logzio-metrics-collector. That's what you'll spot in the containers list and use in commands like docker logs logzio-metrics-collector.
Privileged mode
This template runs Logzio Metrics Collector in privileged mode, which gives it nearly as much access to your server as the system itself. Some apps genuinely need it to reach hardware or manage the host, so it's one to run only if you trust the source.
Open source license
Logzio Metrics Collector is open source, released under the Apache-2.0 license. In plain terms the code is out in the open, so you're free to run it and change it to fit what you need.
Portainer app templates
Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Logzio Metrics Collector up. Add the template list to Portainer once, then deploying Logzio Metrics Collector is a click rather than a wall of config.