目录
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都更有价值。使用 InfluxDB,排名第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法
输入和输出集成概览
使用 Azure Monitor API 从 Azure 资源收集指标。
此插件使 Telegraf 能够使用 Prometheus 远程写入协议将指标发送到 Cortex,从而可以无缝地摄取到 Cortex 的可扩展、多租户时间序列存储中。
集成详情
Azure Monitor
Azure Monitor Telegraf 插件专门设计用于使用 Azure Monitor API 从各种 Azure 资源收集指标。用户必须提供特定的凭据,例如 client_id
、client_secret
、tenant_id
和 subscription_id
,以进行身份验证并获得对其 Azure 资源的访问权限。此外,该插件还支持从单个资源和资源组或订阅收集指标的功能,从而可以根据用户需求灵活且可扩展地收集指标。此插件非常适合利用 Azure 云基础设施的组织,可深入了解资源性能和随时间推移的利用率,从而促进云资源的积极管理和优化。
Cortex
借助 Telegraf 的 HTTP 输出插件和 prometheusremotewrite
数据格式,您可以将指标直接发送到 Cortex,Cortex 是 Prometheus 的水平可扩展长期存储后端。Cortex 支持多租户,并接受使用 Prometheus protobuf 格式的远程写入请求。通过使用 Telegraf 作为收集代理和远程写入作为传输机制,组织可以将可观测性扩展到 Prometheus 本身不支持的源(例如 Windows 主机、启用 SNMP 的设备或自定义应用程序指标),同时利用 Cortex 的高可用性和长期保留能力。
配置
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>
Cortex
[[outputs.http]]
## Cortex Remote Write endpoint
url = "http://cortex.example.com/api/v1/push"
## Use POST to send data
method = "POST"
## Send metrics using Prometheus remote write format
data_format = "prometheusremotewrite"
## Optional HTTP headers for authentication
# [outputs.http.headers]
# X-Scope-OrgID = "your-tenant-id"
# Authorization = "Bearer YOUR_API_TOKEN"
## Optional TLS configuration
# tls_ca = "/path/to/ca.pem"
# tls_cert = "/path/to/cert.pem"
# tls_key = "/path/to/key.pem"
# insecure_skip_verify = false
## Request timeout
timeout = "10s"
输入和输出集成示例
Azure Monitor
-
动态资源监控:使用 Azure Monitor 插件根据特定条件(如标签或资源类型)动态收集 Azure 资源的指标。组织可以自动执行加载和卸载资源指标的过程,从而根据资源利用率模式更好地跟踪和优化性能。
-
多云监控集成:将从 Azure Monitor 收集的指标与其他云提供商集成,使用集中式监控解决方案。这使组织可以查看和分析跨多个云部署的性能数据,从而全面了解资源性能和成本,并简化运营。
-
异常检测和警报:结合机器学习算法,利用通过 Azure Monitor 插件收集的指标来检测资源利用率中的异常。通过建立基准性能指标并自动发出偏差警报,组织可以在风险升级和性能问题升级之前缓解风险并解决性能问题。
-
历史性能分析:通过将数据馈送到数据仓库解决方案中,使用收集的 Azure 指标进行历史分析。这使组织能够跟踪随时间推移的趋势,从而可以根据历史性能数据进行详细报告和决策。
Cortex
-
统一的多租户监控:使用 Telegraf 从不同的团队或环境收集指标,并将它们与单独的
X-Scope-OrgID
标头推送到 Cortex。这实现了每个租户的隔离数据摄取和查询,非常适合托管服务和平台团队。 -
将 Prometheus 覆盖范围扩展到边缘设备:在边缘或物联网设备上部署 Telegraf 以收集系统指标并将它们发送到集中式 Cortex 集群。即使对于没有本地 Prometheus 抓取器的环境,这种方法也能确保一致的可观测性。
-
具有联邦租户的全局服务可观测性:通过配置 Telegraf 代理将数据推送到区域 Cortex 集群(每个集群都标记有租户标识符)来聚合来自全球基础设施的指标。Cortex 处理跨区域的重复数据删除和集中访问。
-
自定义应用程序遥测管道:通过 Telegraf 的
exec
或http
输入插件收集特定于应用程序的遥测数据,并将其转发到 Cortex。这使 DevOps 团队能够以可扩展、查询高效的格式监控特定于应用程序的 KPI,同时保持指标按租户或服务逻辑分组。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都更有价值。使用 InfluxDB,排名第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法