目录
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它会更有价值。InfluxDB 是排名第一的时间序列平台,旨在通过 Telegraf 进行扩展。
查看入门方法
输入和输出集成概述
MQTT Telegraf 插件旨在从指定的 MQTT 主题读取数据并创建指标,使用户能够利用 MQTT 进行实时数据收集和监控。
Graphite 插件使用户能够通过 TCP 将 Telegraf 收集的指标发送到 Graphite 中。这种集成允许使用 Graphite 强大的功能有效地存储和可视化时间序列数据。
集成详情
MQTT
MQTT 插件允许从指定的 MQTT 主题读取指标,并使用支持的输入数据格式创建指标。此插件作为服务输入运行,它侦听传入的指标或事件,而不是像普通插件那样按设定的时间间隔收集它们。该插件的灵活性通过支持各种代理 URL、主题和连接功能(包括服务质量 (QoS) 级别和持久会话)得到增强。其配置选项包含用于修改指标和有效处理启动错误的全局设置。它还支持用于保护用户名和密码选项的密钥存储配置,确保与 MQTT 服务器的安全连接。
Graphite
此插件通过原始 TCP 将指标写入 Graphite,从而可以将 Telegraf 收集的指标无缝集成到 Graphite 生态系统中。使用此插件,用户可以配置多个 TCP 端点以进行负载均衡,从而确保指标传输的高可用性和可靠性。通过前缀自定义指标命名以及利用各种模板选项的能力增强了数据在 Graphite 中表示方式的灵活性。此外,对 Graphite 标签的支持以及对指标名称进行严格清理的选项允许进行强大的数据管理,以满足用户的各种需求。对于希望利用 Graphite 强大的指标存储和可视化功能,同时保持对数据表示的控制的组织来说,此功能至关重要。
配置
MQTT
[[inputs.mqtt_consumer]]
servers = ["tcp://127.0.0.1:1883"]
topics = [
"telegraf/host01/cpu",
"telegraf/+/mem",
"sensors/#",
]
# topic_tag = "topic"
# qos = 0
# connection_timeout = "30s"
# keepalive = "60s"
# ping_timeout = "10s"
# max_undelivered_messages = 1000
# persistent_session = false
# client_id = ""
# username = "telegraf"
# password = "metricsmetricsmetricsmetrics"
# tls_ca = "/etc/telegraf/ca.pem"
# tls_cert = "/etc/telegraf/cert.pem"
# tls_key = "/etc/telegraf/key.pem"
# insecure_skip_verify = false
# client_trace = false
data_format = "influx"
# [[inputs.mqtt_consumer.topic_parsing]]
# topic = ""
# measurement = ""
# tags = ""
# fields = ""
# [inputs.mqtt_consumer.topic_parsing.types]
# key = type
Graphite
# Configuration for Graphite server to send metrics to
[[outputs.graphite]]
## TCP endpoint for your graphite instance.
## If multiple endpoints are configured, the output will be load balanced.
## Only one of the endpoints will be written to with each iteration.
servers = ["localhost:2003"]
## Local address to bind when connecting to the server
## If empty or not set, the local address is automatically chosen.
# local_address = ""
## Prefix metrics name
prefix = ""
## Graphite output template
## see https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
template = "host.tags.measurement.field"
## Strict sanitization regex
## This is the default sanitization regex that is used on data passed to the
## graphite serializer. Users can add additional characters here if required.
## Be aware that the characters, '/' '@' '*' are always replaced with '_',
## '..' is replaced with '.', and '\' is removed even if added to the
## following regex.
# graphite_strict_sanitize_regex = '[^a-zA-Z0-9-:._=\p{L}]'
## Enable Graphite tags support
# graphite_tag_support = false
## Applied sanitization mode when graphite tag support is enabled.
## * strict - uses the regex specified above
## * compatible - allows for greater number of characters
# graphite_tag_sanitize_mode = "strict"
## Character for separating metric name and field for Graphite tags
# graphite_separator = "."
## Graphite templates patterns
## 1. Template for cpu
## 2. Template for disk*
## 3. Default template
# templates = [
# "cpu tags.measurement.host.field",
# "disk* measurement.field",
# "host.measurement.tags.field"
#]
## timeout in seconds for the write connection to graphite
# timeout = "2s"
## 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
输入和输出集成示例
MQTT
-
智能家居监控:使用 MQTT Consumer 插件监控智能家居设置中的各种传感器。在这种情况下,可以将插件配置为订阅不同设备(例如温度、湿度和能耗)的主题。通过聚合这些数据,房主可以可视化趋势并接收异常模式的警报,从而提高家庭自动化系统的整体质量和效率。
-
物联网环境感知:部署 MQTT Consumer 从分布在不同位置的传感器收集环境数据。例如,这可以包括来自空气质量传感器、温度传感器和噪声水平仪的读数。可以将插件配置为从 MQTT 主题中提取相关标签和字段,从而可以大规模详细分析和报告环境条件,从而为城市规划或环境倡议提供更好的决策支持。
-
实时车辆跟踪和遥测:将 MQTT Consumer 插件集成到车辆遥测系统中,该系统实时收集来自各种传感器的数据。借助该插件,可以将与车辆性能、位置和燃油消耗相关的指标发送到集中式监控仪表板。这种实时遥测数据使车队经理能够通过主动数据分析来优化路线、降低燃油成本并改进车辆维护计划。
-
农业监控系统:利用此插件从监控土壤湿度、作物健康和天气状况的农业传感器收集数据。MQTT Consumer 可以订阅与农业设备和环境传感器相关的多个主题,使农民能够做出数据驱动的决策,以提高作物产量,同时节约资源,提高农业可持续性。
Graphite
-
动态指标可视化:Graphite 插件可用于将来自各种来源(例如应用程序性能数据或服务器运行状况指标)的实时指标馈送到 Graphite 中。这种动态集成使团队能够创建交互式仪表板,以可视化关键绩效指标、跟踪随时间变化的趋势并做出数据驱动的决策以提高系统性能。
-
负载均衡指标收集:通过在插件中配置多个 TCP 端点,组织可以实施指标传输的负载均衡。此用例确保指标交付既具有弹性又高效,从而降低了高流量期间数据丢失的风险,并保持了流向 Graphite 的可靠信息流。
-
自定义指标标记:通过支持 Graphite 标签,用户可以使用 Graphite 插件来增强指标的粒度。使用相关信息(例如应用程序环境或服务类型)标记指标,可以进行更精细的查询和分析,使团队能够深入研究特定感兴趣的领域,以获得更好的运营见解。
-
增强的数据清理:利用该插件的严格清理选项,用户可以确保其指标名称符合 Graphite 的要求。这种主动措施消除了指标名称中无效字符可能引起的问题,从而实现了更清洁的数据管理和更准确的可视化。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它会更有价值。InfluxDB 是排名第一的时间序列平台,旨在通过 Telegraf 进行扩展。
查看入门方法