目录
输入和输出集成概述
Fluentd Input Plugin 从 Fluentd 的 in_monitor 插件端点收集指标。它提供对各种插件指标的深入了解,同时允许自定义配置以减少序列基数。
MongoDB Telegraf Plugin 使用户能够将指标发送到 MongoDB 数据库,自动管理时间序列集合。
集成详情
Fluentd
此插件从 in_monitor 插件提供的 Fluentd 插件端点收集指标。它从 /api/plugin.json 资源读取数据,并允许根据插件类型排除特定插件。
MongoDB
此插件将指标发送到 MongoDB,并与其时间序列功能无缝集成,允许在时间序列集合尚不存在时自动创建它们。它需要 MongoDB 5.0 或更高版本才能使用时间序列集合功能,这对于高效存储和查询基于时间的数据至关重要。此插件通过确保所有相关指标都正确存储和组织在 MongoDB 中来增强监控功能,使用户能够利用 MongoDB 强大的查询和聚合功能进行时间序列分析。
配置
Fluentd
[[inputs.fluentd]]
## This plugin reads information exposed by fluentd (using /api/plugins.json endpoint).
##
## Endpoint:
## - only one URI is allowed
## - https is not supported
endpoint = "http://localhost:24220/api/plugins.json"
## Define which plugins have to be excluded (based on "type" field - e.g. monitor_agent)
exclude = [
"monitor_agent",
"dummy",
]
MongoDB
[[outputs.mongodb]]
# connection string examples for mongodb
dsn = "mongodb://localhost:27017"
# dsn = "mongodb://mongod1:27017,mongod2:27017,mongod3:27017/admin&replicaSet=myReplSet&w=1"
# overrides serverSelectionTimeoutMS in dsn if set
# timeout = "30s"
# default authentication, optional
# authentication = "NONE"
# for SCRAM-SHA-256 authentication
# authentication = "SCRAM"
# username = "root"
# password = "***"
# for x509 certificate authentication
# authentication = "X509"
# tls_ca = "ca.pem"
# tls_key = "client.pem"
# # tls_key_pwd = "changeme" # required for encrypted tls_key
# insecure_skip_verify = false
# database to store measurements and time series collections
# database = "telegraf"
# granularity can be seconds, minutes, or hours.
# configuring this value will be based on your input collection frequency.
# see https://docs.mongodb.com/manual/core/timeseries-collections/#create-a-time-series-collection
# granularity = "seconds"
# optionally set a TTL to automatically expire documents from the measurement collections.
# ttl = "360h"
输入和输出集成示例
Fluentd
- 基本配置:设置 Fluentd Input Plugin 以从您的 Fluentd 实例的监控端点收集指标,确保您能够跟踪性能和使用情况统计信息。
- 排除插件:使用
exclude
选项忽略您的监控需求不必要的特定插件指标,从而简化数据收集并专注于重要事项。 - 自定义插件 ID:在您的 Fluentd 配置中实施
@id
参数以保持一致的plugin_id
,这有助于避免频繁重启期间出现的高序列基数问题。
MongoDB
-
物联网设备的动态日志记录到 MongoDB:利用此插件实时收集和存储来自大量物联网设备的指标。通过将设备日志直接发送到 MongoDB,您可以创建一个集中式数据库,以便轻松访问和查询健康指标和性能数据,从而根据历史趋势实现主动维护和故障排除。
-
Web 流量的时间序列分析:使用 MongoDB Telegraf Plugin 收集和分析一段时间内的 Web 流量指标。此应用程序可以帮助您了解高峰使用时间、用户互动和行为模式,这可以指导营销策略和基础设施扩展决策,从而改善用户体验。
-
自动化监控和警报系统:将 MongoDB 插件集成到跟踪应用程序性能指标的自动化监控系统中。借助时间序列集合,您可以根据特定阈值设置警报,使您的团队能够在潜在问题影响用户之前做出响应。这种主动管理可以提高服务可靠性和整体性能。
-
指标存储中的数据保留和 TTL 管理:利用 MongoDB 集合中文档的 TTL 功能自动过期过时的指标。这对于仅最近的性能数据相关的环境尤其有用,可以防止您的 MongoDB 数据库被旧指标弄乱,并确保高效的数据管理。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。