目录
输入和输出集成概述
此插件使用 XML-RPC API 收集有关在 Supervisor 下运行的进程的信息。
InfluxDB 插件将指标写入 InfluxDB HTTP 服务,从而实现时序数据的高效存储和检索。
集成详情
Supervisor
Telegraf 的 Supervisor 插件旨在通过其 XML-RPC API 收集有关 Supervisor 进程控制系统管理的进程的指标。该插件能够跟踪各种指标,包括进程状态和正常运行时间,并提供通过包含或排除列表配置要收集哪些指标的选项。此集成对于监控在 Supervisor 下运行的应用程序特别有用,可以深入了解其运行状态和性能指标。最低测试 Supervisor 版本为 3.3.2,建议使用基本身份验证来保护 HTTP 服务器,以提高安全性。
InfluxDB
InfluxDB Telegraf 插件用于将指标发送到 InfluxDB HTTP API,从而以结构化方式促进时序数据的存储和查询。该插件与 InfluxDB 无缝集成,提供诸如基于令牌的身份验证和对多个 InfluxDB 集群节点的支持等基本功能,从而确保可靠且可扩展的数据摄取。通过其可配置性,用户可以指定诸如组织、目标存储桶和 HTTP 特定设置等选项,从而灵活地定制数据的发送和存储方式。该插件还支持敏感数据的密钥管理,从而增强了生产环境中的安全性。此插件在现代可观测性堆栈中尤其有益,在这些堆栈中,实时分析和时序数据的存储至关重要。
配置
Supervisor
[[inputs.supervisor]]
## Url of supervisor's XML-RPC endpoint if basic auth enabled in supervisor http server,
## than you have to add credentials to url (ex. http://login:pass@localhost:9001/RPC2)
# url="http://localhost:9001/RPC2"
## With settings below you can manage gathering additional information about processes
## If both of them empty, then all additional information will be collected.
## Currently supported supported additional metrics are: pid, rc
# metrics_include = []
# metrics_exclude = ["pid", "rc"]
InfluxDB
[[outputs.influxdb]]
## The full HTTP or UDP URL for your InfluxDB instance.
##
## Multiple URLs can be specified for a single cluster, only ONE of the
## urls will be written to each interval.
# urls = ["unix:///var/run/influxdb.sock"]
# urls = ["udp://127.0.0.1:8089"]
# urls = ["http://127.0.0.1:8086"]
## Local address to bind when connecting to the server
## If empty or not set, the local address is automatically chosen.
# local_address = ""
## The target database for metrics; will be created as needed.
## For UDP url endpoint database needs to be configured on server side.
# database = "telegraf"
## The value of this tag will be used to determine the database. If this
## tag is not set the 'database' option is used as the default.
# database_tag = ""
## If true, the 'database_tag' will not be included in the written metric.
# exclude_database_tag = false
## If true, no CREATE DATABASE queries will be sent. Set to true when using
## Telegraf with a user without permissions to create databases or when the
## database already exists.
# skip_database_creation = false
## Name of existing retention policy to write to. Empty string writes to
## the default retention policy. Only takes effect when using HTTP.
# retention_policy = ""
## The value of this tag will be used to determine the retention policy. If this
## tag is not set the 'retention_policy' option is used as the default.
# retention_policy_tag = ""
## If true, the 'retention_policy_tag' will not be included in the written metric.
# exclude_retention_policy_tag = false
## Write consistency (clusters only), can be: "any", "one", "quorum", "all".
## Only takes effect when using HTTP.
# write_consistency = "any"
## Timeout for HTTP messages.
# timeout = "5s"
## HTTP Basic Auth
# username = "telegraf"
# password = "metricsmetricsmetricsmetrics"
## HTTP User-Agent
# user_agent = "telegraf"
## UDP payload size is the maximum packet size to send.
# udp_payload = "512B"
## Optional TLS Config for use on HTTP connections.
# 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
## HTTP Proxy override, if unset values the standard proxy environment
## variables are consulted to determine which proxy, if any, should be used.
# http_proxy = "http://corporate.proxy:3128"
## Additional HTTP headers
# http_headers = {"X-Special-Header" = "Special-Value"}
## HTTP Content-Encoding for write request body, can be set to "gzip" to
## compress body or "identity" to apply no encoding.
# content_encoding = "gzip"
## When true, Telegraf will output unsigned integers as unsigned values,
## i.e.: "42u". You will need a version of InfluxDB supporting unsigned
## integer values. Enabling this option will result in field type errors if
## existing data has been written.
# influx_uint_support = false
## When true, Telegraf will omit the timestamp on data to allow InfluxDB
## to set the timestamp of the data during ingestion. This is generally NOT
## what you want as it can lead to data points captured at different times
## getting omitted due to similar data.
# influx_omit_timestamp = false
输入和输出集成示例
Supervisor
-
集中监控仪表板:实施此插件以将 Supervisor 指标直接馈送到集中监控仪表板,使团队能够实时可视化其应用程序的运行状况和性能。此集成可以快速识别问题,帮助跟踪一段时间内的服务性能,并根据观察到的趋势帮助进行容量规划。
-
进程故障警报:利用 Supervisor 插件收集的指标来创建警报机制,以便在关键进程关闭或进入致命状态时通知工程师。通过在监控系统中设置阈值,团队可以主动响应潜在问题,最大限度地减少停机时间并确保系统可靠性。
-
进程状态的历史分析:存储随时间收集的指标,以分析进程状态变化和模式。通过检查历史数据,团队可以识别重复出现的问题,跟踪部署更改的影响,并根据进程趋势优化资源分配,从而提高整体系统性能。
-
与事件管理系统集成:配置 Supervisor 插件以在进程达到临界状态时自动向 PagerDuty 或 OpsGenie 等事件管理系统发送警报。此集成简化了事件响应流程,确保及时通知正确的团队成员,并且可以立即采取行动。
InfluxDB
-
实时系统监控:利用 InfluxDB 插件捕获和存储来自各种系统组件(例如 CPU 使用率、内存消耗和磁盘 I/O)的指标。通过将这些指标推送到 InfluxDB,您可以创建一个实时仪表板,以可视化实时系统性能。此设置不仅有助于识别性能瓶颈,还可以通过分析一段时间内的趋势来帮助进行主动容量规划。
-
Web 应用程序的性能跟踪:自动收集并将与 Web 应用程序性能相关的指标(例如请求持续时间、错误率和用户交互)推送到 InfluxDB。通过在监控堆栈中使用此插件,您可以使用存储的指标生成报告和分析,以帮助了解用户行为和应用程序效率,从而指导开发和优化工作。
-
物联网数据聚合:利用 InfluxDB Telegraf 插件从各种物联网设备收集传感器数据,并将其存储在集中的 InfluxDB 实例中。此用例使您能够分析环境或机器数据随时间变化的趋势和模式,从而促进更智能的决策和预测性维护策略。通过将物联网数据集成到 InfluxDB 中,组织可以利用历史数据分析的力量来推动创新和运营效率。
-
分析历史指标以进行预测:设置 InfluxDB 插件以将历史指标数据发送到 InfluxDB,并使用它来驱动预测模型。通过分析过去的性能指标,您可以创建预测未来趋势和需求的预测模型。此应用程序对于商业智能目的特别有用,可以帮助组织根据历史使用模式为资源需求的波动做好准备。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。