Deploy this integration to ship metrics from your Docker Swarm network using containerized Telegraf agent.


Pull the Docker image
docker pull logzio/docker-metrics-collector:latest
Start the collector

Run the following command:

docker service create --name telegraf-docker-collector-metrics \
 --env LOGZIO_LISTENER="https://<<LISTENER-HOST>>:8053" \
 --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
 --mode global logzio/docker-metrics-collector:latest```

Replace the placeholders to match your specifics. (They are indicated by the double angle brackets << >>):

  • Replace <<PROMETHEUS-METRICS-SHIPPING-TOKEN>> with a token for the Metrics account you want to ship to.
    Here’s how to look up your Metrics token.
  • Replace <<LISTENER-HOST>> with the Logz.io Listener URL for your region, configured to use port 8052 for http traffic, or port 8053 for https traffic. For example, listener.logz.io if your account is hosted on AWS US East, or listener-nl.logz.io if hosted on Azure West Europe.

If you prefer to keep these environment variables in an .env file, run the following command:

docker run -d --env-file=docker.env -v /var/run/docker.sock:/var/run/docker.sock logzio/docker-metrics-collector:latest


Below is a list of all environment variables available with this integration. If required, add a variable to the docker run command using the --env flag.

Name Description Required/Default
METRICS_TOKEN Your Logz.io metrics account token. Required
LOGZIO_LISTENER Your Logz.io listener address followed by port 8053. Required/Default: https://listener.logz.io:8053.
DOCKER_ENDPOINT Address to reach the required Docker Daemon. Default: unix:///var/run/docker.sock.
TIMEOUT The request timeout for any Docker Daemon query. Default: 5s.
EXCLUDED_IMAGES A list of strings, regexes, or globs, the container image names of which, will not be among the queried containers. !-prefixed negations are possible for all item types to signify that only unmatched container image names should be monitored. For example: imageNameToExclude1,imageNameToExclude2) Default: nil.
Check Logz.io metrics

Give your data some time to get from your system to ours, then log in to your Logz.io Metrics account, and open the Logz.io Metrics tab.