Tutorial: Shipping Docker Metrics to Logz.io

栏目: IT技术 · 发布时间: 5年前

内容简介:Docker is an essential bridge in modern DevOps. Despite Kubernetes overtaking Docker on orchestrating containers, the Docker container itself remains the standard and likely will for the foreseeable future. We developed the Docker Metrics collector to oper
Tutorial: Shipping Docker Metrics to Logz.io

Docker is an essential bridge in modern DevOps. Despite Kubernetes overtaking Docker on orchestrating containers, the Docker container itself remains the standard and likely will for the foreseeable future. We developed the Docker Metrics collector to operate as its own container that will run Metricbeat using the modules you are running in real time. Now, in addition to the Docker module, we are now releasing an AWS module for operations in the cloud.

The docker module collects the following metrics: container , cpu , diskio , healthcheck , info , memory , and network .

In an earlier tutorial, we covered shipping Docker metrics through Metricbeat to Elasticsearch and on to Kibana. This walkthrough will work with the Logzio Docker Metrics Collector and shipping straight to Logz.io.

In order to install the Docker Metrics Collector, stop your container and add docker to the LOGZIO_MODULES environment variable. At that point, restart.

Docker Metrics Configuration

Pull the Docker image. Download the Docker Metrics Collector image:

docker pull logzio/docker-collector-metrics

Run the container.

For a complete list of options, see the parameters below the code block.:point_down:

docker run --name docker-collector-metrics \
--env LOGZIO_TOKEN="<<SHIPPING-TOKEN>>" \
--env LOGZIO_URL="<<LISTENER-HOST>>" \
--env LOGZIO_MODULES="docker" \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
logzio/docker-collector-metrics

Module Parameters

There are 16 parameters you can (or must) set in the module. The first two on the list are mandatory, otherwise it won’t work:

    1. LOGZIO_TOKEN —This is your Logz.io account token. Replace <<SHIPPING-TOKEN>> with the token of the account you want to ship to.
    2. LOGZIO_URL —This is the Logz.io listener host to ship the metrics to. Replace <<LISTENER-HOST>> with your region’s listener host (for example, listener.logz.io). For more information on finding your account’s region, see Account region.
    3. LOGZIO_MODULES —This is a comma-separated list of Metricbeat modules to be enabled on this container (formatted as module1,module2,module3 ). To use a custom module configuration file, mount its folder to /logzio/logzio_modules .
    4. LOGZIO_TYPE —In this instance, it will be something like docker-collector-metrics . The log type you’ll use with this Docker. This is shown under the type field in Kibana. Logz.io applies parsing based on type .
    5. LOGZIO_LOG_LEVEL —This is the log level the module startup scripts will generate.
    6. LOGZIO_ADDITIONAL_FIELDS —A semicolon-separated list of additional fields to be included with each message sent (formatted as fieldName1=value1;fieldName2=value2 ). To use an environment variable as a value, format as fieldName=$ENV_VAR_NAME . Environment variables must be the only value in the field. Where an environment variable can’t be resolved, the field is omitted.
    7. DOCKER_MATCH_CONTAINER_NAME —This is a comma-separated list of containers you want to collect the metrics from. If a container’s name partially matches a name on the list, that container’s metrics are shipped. Otherwise, its metrics are ignored. Note: This can’t be used with DOCKER_SKIP_CONTAINER_NAME .
    8. DOCKER_SKIP_CONTAINER_NAME —This is a comma-separated list of containers you want to ignore. If a container’s name partially matches a name on the list, that container’s metrics are ignored. Otherwise, its metrics are shipped. Note: This be used with DOCKER_MATCH_CONTAINER_NAME .
    9. DOCKER_PERIOD —Sampling rate of metrics. The Docker API takes up to 2 seconds to respond, so we recommend setting this to 3s or longer.
    10. DOCKER_CERTIFICATE_AUTHORITY —This is the file path to certificate authority for connecting to Docker over TLS.
    11. DOCKER_CERTIFICATE —This is the file path to CA certificate for connecting to Docker over TLS.
    12. DOCKER_KEY —This is the file path to Docker key for connecting to Docker over TLS.

It will take a few minutes for the metrics to appear in our system. Beforehand, you should have a dashboard ready to go. If you want to customize a dashboard but need to go with something to display things in the meantime, we have a pre-fab set of dashboards for different platforms in Logz.io, including Docker.

Tutorial: Shipping Docker Metrics to Logz.io


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

来自圣经的证明

来自圣经的证明

M.Aigner、G.M.Ziegler / 世界图书出版公司 / 2006-7 / 39.00元

作为一门历史悠久的学问,数学有她自身的文化和美学,就像文学和艺术一样。一方面,数学家们在努力开拓新领域、解决老问题;另一方面他们也在不断地从不同的角度反复学习、理解和欣赏前辈们的工作。的确,数学中有许多不仅值得反复推敲理解,更值得细心品味和欣赏的杰作。有些定理的证明不仅想法奇特、构思精巧,作为一个整体更是天衣无缝。难怪,西方有些虔诚的数学家将这类杰作比喻为上帝的创造。 本书已被译成8种文字。......一起来看看 《来自圣经的证明》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具