使用 DataFlux 采集 Docker 监控指标并展示

简介:

DataFlux是上海驻云自研发的一套大数据统一分析平台,可以通过对任何来源、类型、规模的实时数据进行监控、分析和处理,释放数据价值。

DataFlux包含五大功能模块:

  • Datakit 采集器
  • Dataway 数据网关
  • DataFlux Studio 实时数据洞察平台
  • DataFlux Admin Console 管理后台
  • DataFlux.f(x) 实时数据处理开发平台
    image

面向企业提供全场景的数据洞察分析能力, 具有实时性、灵活性、易扩展、易部署等特点。

安装DataKit

PS:以Linux系统为例

第一步:执行安装命令

DataKit 安装命令:

DK_FTDATAWAY=[你的 DataWay 网关地址] bash -c "$(curl https://static.dataflux.cn/datakit/install.sh)"

补充安装命令中的 DataWay 网关地址,然后复制安装命令到主机上执行即可。

例如:如果的 DataWay 网关地址 IP 为 1.2.3.4,端口为 9528(9528为默认端口),则网关地址为
http://1.2.3.4:9528/v1/write/metrics,安装命令为:

DK_FTDATAWAY=http://1.2.3.4:9528/v1/write/metrics bash -c "$(curl https://static.dataflux.cn/datakit/install.sh)"

安装完成后,DataKit 默认会自动运行,并且会在终端中提示 DataKit 的状态管理命令
image

Docker 指标采集

采集 docker 指标上报到 DataFlux 中

  • 已安装 DataKit(DataKit 安装文档)
    打开 DataKit 采集源配置文件夹(默认路径为 DataKit 安装目录的 conf.d 文件夹),找到 docker 文件夹,打开里面的 docker.conf。

image

设置:

# Read metrics about docker containers
[[inputs.docker]]
  ## Docker Endpoint
  ##   To use TCP, set endpoint = "tcp://[ip]:[port]"
  ##   To use environment variables (ie, docker-machine), set endpoint = "ENV"
  endpoint = "unix:///var/run/docker.sock"

  ## Set to true to collect Swarm metrics(desired_replicas, running_replicas)
  ## Note: configure this in one of the manager nodes in a Swarm cluster.
  ## configuring in multiple Swarm managers results in duplication of metrics.
  gather_services = false

  ## Only collect metrics for these containers. Values will be appended to
  ## container_name_include.
  ## Deprecated (1.4.0), use container_name_include
  container_names = []

  ## Set the source tag for the metrics to the container ID hostname, eg first 12 chars
  source_tag = false

  ## Containers to include and exclude. Collect all if empty. Globs accepted.
  container_name_include = []
  container_name_exclude = []

  ## Container states to include and exclude. Globs accepted.
  ## When empty only containers in the "running" state will be captured.
  ## example: container_state_include = ["created", "restarting", "running", "removing", "paused", "exited", "dead"]
  ## example: container_state_exclude = ["created", "restarting", "running", "removing", "paused", "exited", "dead"]
  # container_state_include = []
  # container_state_exclude = []

  ## Timeout for docker list, info, and stats commands
  timeout = "5s"

  ## Whether to report for each container per-device blkio (8:0, 8:1...) and
  ## network (eth0, eth1, ...) stats or not
  perdevice = true

  ## Whether to report for each container total blkio and network stats or not
  total = false

  ## docker labels to include and exclude as tags.  Globs accepted.
  ## Note that an empty array for both will include all labels as tags
  docker_label_include = []
  docker_label_exclude = []

  ## Which environment variables should we use as a tag
  tag_env = ["JAVA_HOME", "HEAP_SIZE"]

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

配置好后,重启 DataKit 即可生效

验证数据上报

完成数据采集操作后,我们需要验证数据是否采集成功并且上报到DataWay,以便后续能正常进行数据分析及展示

操作步骤:登录DataFlux——数据管理——指标浏览——验证数据是否采集成功

Docker 指标:
image

使用DataFlux实现数据洞察

根据获取到的指标项进行数据洞察设计,例如:

Docker 监控视图
image

DataFlux基于自研的DataKit数据(采集器)目前已经可以对接超过200种数据协议,包括:云端数据采集、应用数据采集、日志数据采集、时序数据上报、常用数据库的数据汇聚,帮助企业实现最便捷的IT 统一监控。
image

相关文章
|
5月前
|
监控 网络协议 Linux
使用Docker部署监控服务Uptime Kuma并实现无公网ip远程访问本地服务
使用Docker部署监控服务Uptime Kuma并实现无公网ip远程访问本地服务
307 0
|
1月前
|
Prometheus 监控 Cloud Native
docker安装prometheus+Granfan并监控容器
【9月更文挑战第14天】本文介绍了在Docker中安装Prometheus与Grafana并监控容器的步骤,包括创建配置文件、运行Prometheus与Grafana容器,以及在Grafana中配置数据源和创建监控仪表盘,展示了如何通过Prometheus抓取数据并利用Grafana展示容器的CPU使用率等关键指标。
|
5月前
|
Prometheus 监控 Cloud Native
构建高效稳定的Docker容器监控体系
【5月更文挑战第20天】 在微服务架构日益普及的今天,Docker作为其重要的实现技术之一,承载着大量应用的运行。然而,随之而来的是对于容器健康状态、资源使用情况以及性能指标的监控需求急剧增加。本文旨在探讨构建一个高效且稳定的Docker容器监控体系,不仅涵盖了监控工具的选择与配置,还详细阐述了监控数据的分析与处理流程。通过精心设计的监控策略和实时响应机制,我们能够确保系统的稳定性,并及时发现及处理潜在的问题。
|
5月前
|
监控 Ubuntu Docker
Sentry 监控 Docker 方式部署
Sentry 监控 Docker 方式部署
436 0
|
2月前
|
存储 监控 API
如何监控 Docker 的状态
【8月更文挑战第24天】
81 0
|
4月前
|
监控 JavaScript 测试技术
【Docker项目实战】使用Docker部署kener监控面板
【6月更文挑战第8天】使用Docker部署kener监控面板
83 10
|
4月前
|
监控 Java 数据安全/隐私保护
性能监控之 JMX 监控 Docker 容器中的 Java 应用
【6月更文挑战9天】性能监控之 JMX 监控 Docker 容器中的 Java 应用
602 1
|
5月前
|
存储 运维 监控
【Docker专栏】Docker日志管理与监控的最佳方法
【5月更文挑战第7天】本文探讨了Docker容器的日志管理与监控,强调其在运维中的重要性。Docker默认使用`json-file`日志驱动,可通过`docker logs`命令查看。建议选择合适日志驱动,配置日志选项,并集成ELK Stack等工具进行高级分析。实时监控、设置警报、分析数据和审计日志是实践关键。最佳实践包括日志数据与容器数据分离、使用日志代理、保护敏感信息及遵守法规。关注新技术以提升系统稳定性和安全性。
854 10
【Docker专栏】Docker日志管理与监控的最佳方法
|
5月前
|
Prometheus 监控 Cloud Native
构建高效稳定的Docker容器监控体系
【5月更文挑战第13天】在微服务架构和容器化部署日益普及的背景下,对Docker容器的监控变得尤为重要。本文将探讨一种构建高效稳定Docker容器监控体系的方法,通过集成Prometheus和cAdvisor工具,实现对容器资源使用情况、性能指标和运行状态的实时监控。同时,结合Grafana进行数据可视化,为运维人员提供直观的分析界面,以便及时发现和解决潜在问题,保障系统的高可用性和稳定性。
320 6
|
5月前
|
Prometheus 监控 Cloud Native
构建高效稳定的Docker容器监控体系
【5月更文挑战第14天】 在现代微服务架构中,Docker容器作为应用部署的基本单元,其运行状态的监控对于保障系统稳定性和性能至关重要。本文将探讨如何构建一个高效且稳定的Docker容器监控体系,涵盖监控工具的选择、关键指标的采集、数据可视化以及告警机制的设计。通过对Prometheus和Grafana的整合使用,实现对容器资源利用率、网络IO以及应用健康状态的全方位监控,确保系统的高可用性和故障快速响应。