目录
输入和输出集成概述
使用 Azure Monitor API 从 Azure 资源收集指标。
InfluxDB 插件将指标写入 InfluxDB HTTP 服务,从而实现时间序列数据的高效存储和检索。
集成详情
Azure Monitor
Azure Monitor Telegraf 插件专门设计用于使用 Azure Monitor API 从各种 Azure 资源收集指标。用户必须提供特定的凭据,例如 `client_id`、`client_secret`、`tenant_id` 和 `subscription_id`,以进行身份验证并访问其 Azure 资源。此外,该插件还支持从单个资源以及资源组或订阅收集指标的功能,从而可以根据用户需求灵活且可扩展地收集指标。此插件非常适合利用 Azure 云基础设施的组织,可以深入了解资源性能和长期利用率,从而促进云资源的积极管理和优化。
InfluxDB
InfluxDB Telegraf 插件用于将指标发送到 InfluxDB HTTP API,从而以结构化方式促进时间序列数据的存储和查询。该插件与 InfluxDB 无缝集成,提供诸如基于令牌的身份验证和对多个 InfluxDB 集群节点的支持等基本功能,从而确保可靠且可扩展的数据摄取。通过其可配置性,用户可以指定诸如组织、目标存储桶和 HTTP 特定设置等选项,从而灵活地定制数据的发送和存储方式。该插件还支持敏感数据的秘密管理,从而增强了生产环境中的安全性。此插件在现代可观测性堆栈中尤其有益,在这些堆栈中,实时分析和时间序列数据的存储至关重要。
配置
Azure Monitor
# Gather Azure resources metrics from Azure Monitor API
[[inputs.azure_monitor]]
# can be found under Overview->Essentials in the Azure portal for your application/service
subscription_id = "<>"
# can be obtained by registering an application under Azure Active Directory
client_id = "<>"
# can be obtained by registering an application under Azure Active Directory.
# If not specified Default Azure Credentials chain will be attempted:
# - Environment credentials (AZURE_*)
# - Workload Identity in Kubernetes cluster
# - Managed Identity
# - Azure CLI auth
# - Developer Azure CLI auth
client_secret = "<>"
# can be found under Azure Active Directory->Properties
tenant_id = "<>"
# Define the optional Azure cloud option e.g. AzureChina, AzureGovernment or AzurePublic. The default is AzurePublic.
# cloud_option = "AzurePublic"
# resource target #1 to collect metrics from
[[inputs.azure_monitor.resource_target]]
# can be found under Overview->Essentials->JSON View in the Azure portal for your application/service
# must start with 'resourceGroups/...' ('/subscriptions/xxxxxxxx-xxxx-xxxx-xxx-xxxxxxxxxxxx'
# must be removed from the beginning of Resource ID property value)
resource_id = "<>"
# the metric names to collect
# leave the array empty to use all metrics available to this resource
metrics = [ "<>", "<>" ]
# metrics aggregation type value to collect
# can be 'Total', 'Count', 'Average', 'Minimum', 'Maximum'
# leave the array empty to collect all aggregation types values for each metric
aggregations = [ "<>", "<>" ]
# resource target #2 to collect metrics from
[[inputs.azure_monitor.resource_target]]
resource_id = "<>"
metrics = [ "<>", "<>" ]
aggregations = [ "<>", "<>" ]
# resource group target #1 to collect metrics from resources under it with resource type
[[inputs.azure_monitor.resource_group_target]]
# the resource group name
resource_group = "<>"
# defines the resources to collect metrics from
[[inputs.azure_monitor.resource_group_target.resource]]
# the resource type
resource_type = "<>"
metrics = [ "<>", "<>" ]
aggregations = [ "<>", "<>" ]
# defines the resources to collect metrics from
[[inputs.azure_monitor.resource_group_target.resource]]
resource_type = "<>"
metrics = [ "<>", "<>" ]
aggregations = [ "<>", "<>" ]
# resource group target #2 to collect metrics from resources under it with resource type
[[inputs.azure_monitor.resource_group_target]]
resource_group = "<>"
[[inputs.azure_monitor.resource_group_target.resource]]
resource_type = "<>"
metrics = [ "<>", "<>" ]
aggregations = [ "<>", "<>" ]
# subscription target #1 to collect metrics from resources under it with resource type
[[inputs.azure_monitor.subscription_target]]
resource_type = "<>"
metrics = [ "<>", "<>" ]
aggregations = [ "<>", "<>" ]
# subscription target #2 to collect metrics from resources under it with resource type
[[inputs.azure_monitor.subscription_target]]
resource_type = "<>"
metrics = [ "<>", "<>" ]
aggregations = [ "<>", "<>" ]
</code></pre>
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
输入和输出集成示例
Azure Monitor
-
动态资源监控:使用 Azure Monitor 插件根据特定标准(如标签或资源类型)动态收集 Azure 资源的指标。组织可以自动化加载和卸载资源指标的过程,从而根据资源利用率模式更好地跟踪和优化性能。
-
多云监控集成:使用集中式监控解决方案将从 Azure Monitor 收集的指标与其他云提供商集成。这使组织可以查看和分析跨多个云部署的性能数据,从而全面了解资源性能和成本,并简化运营。
-
异常检测和警报:结合机器学习算法,利用通过 Azure Monitor 插件收集的指标来检测资源利用率中的异常。通过建立基线性能指标并自动警报偏差,组织可以降低风险并在性能问题升级之前解决它们。
-
历史性能分析:通过将数据馈送到数据仓库解决方案中,使用收集的 Azure 指标进行历史分析。这使组织可以跟踪随时间变化的趋势,从而可以根据历史性能数据进行详细的报告和决策。
InfluxDB
-
实时系统监控:利用 InfluxDB 插件捕获和存储来自各种系统组件的指标,例如 CPU 使用率、内存消耗和磁盘 I/O。通过将这些指标推送到 InfluxDB,您可以创建一个实时仪表板,以可视化实时系统性能。此设置不仅有助于识别性能瓶颈,还有助于通过分析长期趋势来主动进行容量规划。
-
Web 应用程序的性能跟踪:自动收集与 Web 应用程序性能相关的指标(例如请求持续时间、错误率和用户交互),并将它们推送到 InfluxDB。通过在您的监控堆栈中使用此插件,您可以使用存储的指标生成报告和分析,以帮助了解用户行为和应用程序效率,从而指导开发和优化工作。
-
物联网数据聚合:利用 InfluxDB Telegraf 插件从各种物联网设备收集传感器数据,并将其存储在集中的 InfluxDB 实例中。此用例使您能够分析环境或机器数据随时间变化的趋势和模式,从而促进更智能的决策和预测性维护策略。通过将物联网数据集成到 InfluxDB 中,组织可以利用历史数据分析的力量来推动创新和运营效率。
-
分析历史指标进行预测:设置 InfluxDB 插件以将历史指标数据发送到 InfluxDB,并使用它来驱动预测模型。通过分析过去的性能指标,您可以创建预测未来趋势和需求的预测模型。此应用程序对于商业智能目的特别有用,可帮助组织根据历史使用模式为资源需求的波动做好准备。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提供意见。请在 InfluxDB 社区 Slack 中提交您的反馈。