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


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

查看所有标签

猜你喜欢:

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

机器学习算法原理与编程实践

机器学习算法原理与编程实践

郑捷 / 电子工业出版社 / 2015-11 / 88.00

本书是机器学习原理和算法编码实现的基础性读物,内容分为两大主线:单个算法的原理讲解和机器学习理论的发展变迁。算法除包含传统的分类、聚类、预测等常用算法之外,还新增了深度学习、贝叶斯网、隐马尔科夫模型等内容。对于每个算法,均包括提出问题、解决策略、数学推导、编码实现、结果评估几部分。数学推导力图做到由浅入深,深入浅出。结构上数学原理与程序代码一一对照,有助于降低学习门槛,加深公式的理解,起到推广和扩......一起来看看 《机器学习算法原理与编程实践》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

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

Base64 编码/解码