使用 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

相关文章
|
4月前
|
Prometheus 监控 Cloud Native
基于docker搭建监控系统&日志收集
Prometheus 是一款由 SoundCloud 开发的开源监控报警系统及时序数据库(TSDB),支持多维数据模型和灵活查询语言,适用于大规模集群监控。它通过 HTTP 拉取数据,支持服务发现、多种图表展示(如 Grafana),并可结合 Loki 实现日志聚合。本文介绍其架构、部署及与 Docker 集成的监控方案。
447 122
基于docker搭建监控系统&日志收集
|
8月前
|
Prometheus 监控 Cloud Native
除了Prometheus,还有哪些工具可以监控Docker Swarm集群的资源使用情况?
除了Prometheus,还有哪些工具可以监控Docker Swarm集群的资源使用情况?
648 79
|
9月前
|
监控 Java Go
无感改造,完美监控:Docker 多阶段构建 Go 应用无侵入观测
本文将介绍一种基于 Docker 多阶段构建的无侵入 Golang 应用观测方法,通过此方法用户无需对 Golang 应用源代码或者编译指令做任何改造,即可零成本为 Golang 应用注入可观测能力。
452 85
|
6月前
|
Prometheus 监控 Cloud Native
Docker 部署 Prometheus 和 Grafana 监控 Spring Boot 服务
Docker 部署 Prometheus 和 Grafana 监控 Spring Boot 服务实现步骤
641 0
|
Prometheus 监控 Cloud Native
如何监控Docker Swarm集群的性能?
如何监控Docker Swarm集群的性能?
639 64
|
12月前
|
监控 Java 应用服务中间件
tomcat相关概念与部署tomcat多实例-zabbix监控(docker部署)
通过上述步骤,您可以在Ubuntu系统上成功编译并安装OpenCV 4.8。这种方法不仅使您能够定制OpenCV的功能,还可以优化性能以满足特定需求。确保按照每一步进行操作,以避免常见的编译问题。
182 23
|
监控 Java 应用服务中间件
tomcat相关概念与部署tomcat多实例-zabbix监控(docker部署)
通过上述步骤,您可以在Ubuntu系统上成功编译并安装OpenCV 4.8。这种方法不仅使您能够定制OpenCV的功能,还可以优化性能以满足特定需求。确保按照每一步进行操作,以避免常见的编译问题。
288 25

热门文章

最新文章