目录
输入和输出集成概述
此插件将从 Amazon CloudWatch 拉取指标统计信息,从而简化监控和分析 AWS 资源的过程。
Graphite 插件使用户能够通过 TCP 将 Telegraf 收集的指标发送到 Graphite 中。此集成允许使用 Graphite 的强大功能高效地存储和可视化时序数据。
集成详情
亚马逊 CloudWatch
Amazon CloudWatch 插件允许用户从 Amazon 的 CloudWatch 服务中拉取详细的指标统计信息。作为一种监控解决方案,CloudWatch 使用户能够跟踪与 AWS 资源和应用程序相关的各种指标,从而改进运营和性能洞察。该插件使用结构化身份验证方法,通过 STS(安全令牌服务)、共享凭证、环境变量和 EC2 实例配置文件相结合,优先考虑安全性和灵活性,确保对 AWS 资源的强大访问控制。主要功能包括定义特定指标命名空间、指标聚合周期以及可选包含链接账户以进行跨账户监控的能力。此插件的一个重要方面是它能够处理稀疏和密集指标格式,从而根据用户偏好允许不同的输出结构。因此,它通过直接从 CloudWatch 提供全面、及时的数据,支持云监控和分析中的各种用例。
Graphite
此插件通过原始 TCP 将指标写入 Graphite,从而允许将 Telegraf 收集的指标无缝集成到 Graphite 生态系统中。借助此插件,用户可以配置多个 TCP 端点以进行负载均衡,从而确保指标传输的高可用性和可靠性。使用前缀自定义指标命名以及利用各种模板选项的能力增强了数据在 Graphite 中表示方式的灵活性。此外,对 Graphite 标签的支持以及对指标名称进行严格清理的选项允许进行强大的数据管理,满足用户的各种需求。这种能力对于希望利用 Graphite 强大的指标存储和可视化功能,同时保持对数据表示控制的组织至关重要。
配置
亚马逊 CloudWatch
[[inputs.cloudwatch]]
region = "us-east-1"
# access_key = ""
# secret_key = ""
# token = ""
# role_arn = ""
# web_identity_token_file = ""
# role_session_name = ""
# profile = ""
# shared_credential_file = ""
# include_linked_accounts = false
# endpoint_url = ""
# use_system_proxy = false
# http_proxy_url = "http://localhost:8888"
period = "5m"
delay = "5m"
interval = "5m"
#recently_active = "PT3H"
# cache_ttl = "1h"
namespaces = ["AWS/ELB"]
# metric_format = "sparse"
# ratelimit = 25
# timeout = "5s"
# batch_size = 500
# statistic_include = ["average", "sum", "minimum", "maximum", sample_count]
# statistic_exclude = []
# [[inputs.cloudwatch.metrics]]
# names = ["Latency", "RequestCount"]
# [[inputs.cloudwatch.metrics.dimensions]]
# name = "LoadBalancerName"
# value = "p-example"
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
输入和输出集成示例
亚马逊 CloudWatch
-
跨账户监控:通过启用
include_linked_accounts
选项,利用此插件监控多个 AWS 账户中的资源。这种情况允许管理多个 AWS 账户的公司将指标聚合到中央监控仪表板中,从而提供所有指标的统一视图,同时通过适当的角色管理确保安全的数据访问和合规性。 -
动态警报系统:将此插件与警报工具集成,以创建一个自动化系统,该系统根据 CloudWatch 指标的已定义阈值触发警报。例如,如果延迟指标超过指定限制,则可以将警报发送给相关团队,从而能够主动响应性能问题并减少停机时间。
-
成本管理仪表板:使用从插件收集的指标构建成本管理仪表板,该仪表板可视化 AWS 服务使用指标随时间的变化。通过将这些指标与账单数据关联起来,组织可以识别高成本服务,并采取明智的措施来优化其资源使用和支出。
-
应用程序的性能基准测试:利用从 AWS 上运行的应用程序收集的指标来执行性能基准测试。例如,通过跟踪 ELB 的延迟和请求计数指标,开发人员可以评估应用程序更改对其性能的影响,从而为优化做出数据驱动的决策。
Graphite
-
动态指标可视化:Graphite 插件可用于将来自各种来源的实时指标(例如应用程序性能数据或服务器健康指标)馈送到 Graphite 中。这种动态集成使团队能够创建交互式仪表板,可视化关键绩效指标、跟踪随时间变化的趋势,并做出数据驱动的决策以增强系统性能。
-
负载均衡的指标收集:通过在插件中配置多个 TCP 端点,组织可以为指标传输实施负载均衡。这种情况确保指标交付既具有弹性又高效,降低了高流量期间数据丢失的风险,并保持了到 Graphite 的可靠信息流。
-
自定义指标标记:凭借对 Graphite 标签的支持,用户可以利用 Graphite 插件来增强其指标的粒度。使用相关信息(例如应用程序环境或服务类型)标记指标,可以进行更精细的查询和分析,使团队能够深入了解特定感兴趣的领域,从而获得更好的运营洞察。
-
增强的数据清理:利用插件的严格清理选项,用户可以确保其指标名称符合 Graphite 的要求。这种主动措施消除了指标名称中无效字符引起的潜在问题,从而实现更清洁的数据管理和更准确的可视化效果。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。