目录
输入和输出集成概述
MQTT Telegraf 插件旨在从指定的 MQTT 主题读取数据并创建指标,使用户能够利用 MQTT 进行实时数据收集和监控。
Sumo Logic 插件旨在促进将指标从 Telegraf 发送到 Sumo Logic 的 HTTP 源。 通过使用此插件,用户可以在 Sumo Logic 平台中分析其指标数据,利用各种输出数据格式。
集成详情
MQTT
MQTT 插件允许从指定的 MQTT 主题读取指标,并使用支持的输入数据格式创建指标。 此插件作为服务输入运行,它侦听传入的指标或事件,而不是像普通插件那样按设定的时间间隔收集它们。 该插件的灵活性通过支持各种代理 URL、主题和连接功能(包括服务质量 (QoS) 级别和持久会话)得到增强。 其配置选项包含用于修改指标和有效处理启动错误的全局设置。 它还支持用于保护用户名和密码选项的密钥存储配置,确保与 MQTT 服务器的安全连接。
Sumo Logic
此插件有助于将指标传输到 Sumo Logic 的 HTTP 源,并采用指定的数据格式用于 HTTP 消息。 Telegraf(必须是 1.16.0 或更高版本)可以发送以多种格式编码的指标,包括 graphite
、carbon2
和 prometheus
。 这些格式对应于 Sumo Logic 识别的不同内容类型,确保指标得到正确解释以进行分析。 与 Sumo Logic 的集成使用户能够利用全面的分析平台,从而从其指标数据中获得丰富的可视化效果和见解。 该插件提供配置选项,例如设置 HTTP 指标源的 URL、选择数据格式以及指定超时和请求大小等附加参数,从而增强了数据监控工作流程的灵活性和控制力。
配置
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
Sumo Logic
[[outputs.sumologic]]
## Unique URL generated for your HTTP Metrics Source.
## This is the address to send metrics to.
# url = "https://events.sumologic.net/receiver/v1/http/"
## Data format to be used for sending metrics.
## This will set the "Content-Type" header accordingly.
## Currently supported formats:
## * graphite - for Content-Type of application/vnd.sumologic.graphite
## * carbon2 - for Content-Type of application/vnd.sumologic.carbon2
## * prometheus - for Content-Type of application/vnd.sumologic.prometheus
##
## More information can be found at:
## https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Upload-Metrics-to-an-HTTP-Source#content-type-headers-for-metrics
##
## NOTE:
## When unset, telegraf will by default use the influx serializer which is currently unsupported
## in HTTP Source.
data_format = "carbon2"
## Timeout used for HTTP request
# timeout = "5s"
## Max HTTP request body size in bytes before compression (if applied).
## By default 1MB is recommended.
## NOTE:
## Bear in mind that in some serializer a metric even though serialized to multiple
## lines cannot be split any further so setting this very low might not work
## as expected.
# max_request_body_size = 1000000
## Additional, Sumo specific options.
## Full list can be found here:
## https://help.sumologic.com/03Send-Data/Sources/02Sources-for-Hosted-Collectors/HTTP-Source/Upload-Metrics-to-an-HTTP-Source#supported-http-headers
## Desired source name.
## Useful if you want to override the source name configured for the source.
# source_name = ""
## Desired host name.
## Useful if you want to override the source host configured for the source.
# source_host = ""
## Desired source category.
## Useful if you want to override the source category configured for the source.
# source_category = ""
## Comma-separated key=value list of dimensions to apply to every metric.
## Custom dimensions will allow you to query your metrics at a more granular level.
# dimensions = ""
</code></pre>
输入和输出集成示例
MQTT
-
智能家居监控:使用 MQTT Consumer 插件来监控智能家居设置中的各种传感器。 在这种情况下,可以将插件配置为订阅不同设备的主题,例如温度、湿度和能耗。 通过聚合这些数据,房主可以可视化趋势并接收异常模式的警报,从而提高家庭自动化系统的整体质量和效率。
-
物联网环境传感:部署 MQTT Consumer 以收集来自分布在不同位置的传感器的环境数据。 例如,这可以包括来自空气质量传感器、温度传感器和噪声水平仪的读数。 可以将插件配置为从 MQTT 主题中提取相关标签和字段,从而可以对大规模环境条件进行详细分析和报告,从而为城市规划或环境倡议提供更好的决策支持。
-
实时车辆跟踪和遥测:将 MQTT Consumer 插件集成到车辆遥测系统中,该系统实时收集来自各种传感器的数据。 使用该插件,可以将与车辆性能、位置和燃料消耗相关的指标发送到集中监控仪表板。 这种实时遥测数据使车队经理能够通过主动数据分析优化路线、降低燃料成本并改进车辆维护计划。
-
农业监控系统:利用此插件从监控土壤湿度、作物健康状况和天气状况的农业传感器收集数据。 MQTT Consumer 可以订阅与农业设备和环境传感器相关的多个主题,使农民能够做出数据驱动的决策,以提高作物产量,同时节约资源,增强农业的可持续性。
Sumo Logic
-
实时系统监控仪表板:利用 Sumo Logic 插件将服务器的性能指标持续馈送到 Sumo Logic 仪表板。 这种设置使技术团队能够实时可视化系统运行状况和负载,从而通过详细的图表和指标更快地识别任何性能瓶颈或系统故障。
-
自动化警报系统:配置插件以发送在 Sumo Logic 中为特定阈值(例如 CPU 使用率或内存消耗)触发警报的指标。 通过设置自动化警报,团队可以在问题升级为严重故障之前主动解决问题,从而显着缩短响应时间并提高整体系统可靠性。
-
跨系统指标聚合:跨不同环境(开发、测试、生产)集成多个 Telegraf 实例,并使用此插件将所有指标汇总到中央 Sumo Logic 实例。 这种聚合可以实现跨环境的全面分析,从而在整个软件开发生命周期中促进更好的监控和更明智的决策。
-
具有维度跟踪的自定义指标:使用 Sumo Logic 插件发送自定义指标,其中包括标识基础设施各个方面的维度(例如,环境、服务类型)。 这种精细的跟踪允许进行更有针对性的分析,使您的团队能够剖析跨不同应用程序层或业务功能的性能。
反馈
感谢您成为我们社区的一份子! 如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。 请在 InfluxDB 社区 Slack 中提交您的反馈。