Overview

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

Setup

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

Run the following command:

docker run --name telegraf-docker-collector-metrics \
 --env METRICS_TOKEN="<<PROMETHEUS-METRICS-SHIPPING-TOKEN>>" \
 --env LOGZIO_LISTENER="https://<<LISTENER-HOST>>:8053" \
 -v /var/run/docker.sock:/var/run/docker.sock \
 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

Parameters

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.
GLOBAL_TAGS A comma separated list of key-value pairs that will be added to every metric. For example - key1=value1,key2=value2 Default: nil.
Check Logz.io metrics

Log in to your Logz.io account and navigate to the current instructions page inside the Logz.io app. Install the pre-built dashboards to enhance the observability of your metrics.

To view the metrics on the main dashboard, log in to your Logz.io Metrics account, and open the Logz.io Metrics tab.