目录
强大性能,无限扩展
收集、组织和处理海量高速数据。 当您将任何数据视为时间序列数据时,它会更有价值。 使用 InfluxDB(第一的时间序列平台),它旨在通过 Telegraf 进行扩展。
查看入门方法
输入和输出集成概述
此插件允许通过 Stackdriver Monitoring API 从 Google Cloud 服务收集监控数据。 它旨在通过收集相关指标,帮助用户监控其云基础设施的性能和运行状况。
此插件使 Telegraf 能够使用 Prometheus remote write 协议将指标发送到 Cortex,从而实现无缝摄取到 Cortex 的可扩展、多租户时序存储中。
集成详情
Google Cloud Stackdriver
Stackdriver Telegraf 插件允许用户使用 Cloud Monitoring API v3 从 Google Cloud Monitoring 查询时序数据。 通过此插件,用户可以轻松地将 Google Cloud 监控指标集成到他们的监控堆栈中。 此 API 提供了有关 Google Cloud 中运行的资源和应用程序的大量见解,包括性能、正常运行时间和运营指标。 该插件支持各种配置选项来过滤和优化检索到的数据,使用户能够根据其特定需求自定义其监控设置。 此集成有助于更顺畅地维护云资源的运行状况和性能,并帮助团队根据历史和当前性能统计数据做出数据驱动的决策。
Cortex
借助 Telegraf 的 HTTP 输出插件和 `prometheusremotewrite` 数据格式,您可以将指标直接发送到 Cortex,Cortex 是 Prometheus 的水平可扩展长期存储后端。 Cortex 支持多租户,并使用 Prometheus protobuf 格式接受 remote write 请求。 通过使用 Telegraf 作为收集代理,Remote Write 作为传输机制,组织可以将可观测性扩展到 Prometheus 本身不支持的来源(例如 Windows 主机、支持 SNMP 的设备或自定义应用程序指标),同时利用 Cortex 的高可用性和长期保留能力。
配置
Google Cloud Stackdriver
[[inputs.stackdriver]]
## GCP Project
project = "erudite-bloom-151019"
## Include timeseries that start with the given metric type.
metric_type_prefix_include = [
"compute.googleapis.com/",
]
## Exclude timeseries that start with the given metric type.
# metric_type_prefix_exclude = []
## Most metrics are updated no more than once per minute; it is recommended
## to override the agent level interval with a value of 1m or greater.
interval = "1m"
## Maximum number of API calls to make per second. The quota for accounts
## varies, it can be viewed on the API dashboard:
## https://cloud.google.com/monitoring/quotas#quotas_and_limits
# rate_limit = 14
## The delay and window options control the number of points selected on
## each gather. When set, metrics are gathered between:
## start: now() - delay - window
## end: now() - delay
#
## Collection delay; if set too low metrics may not yet be available.
# delay = "5m"
#
## If unset, the window will start at 1m and be updated dynamically to span
## the time between calls (approximately the length of the plugin interval).
# window = "1m"
## TTL for cached list of metric types. This is the maximum amount of time
## it may take to discover new metrics.
# cache_ttl = "1h"
## If true, raw bucket counts are collected for distribution value types.
## For a more lightweight collection, you may wish to disable and use
## distribution_aggregation_aligners instead.
# gather_raw_distribution_buckets = true
## Aggregate functions to be used for metrics whose value type is
## distribution. These aggregate values are recorded in in addition to raw
## bucket counts; if they are enabled.
##
## For a list of aligner strings see:
## https://cloud.google.com/monitoring/api/ref_v3/rpc/google.monitoring.v3#aligner
# distribution_aggregation_aligners = [
# "ALIGN_PERCENTILE_99",
# "ALIGN_PERCENTILE_95",
# "ALIGN_PERCENTILE_50",
# ]
## Filters can be added to reduce the number of time series matched. All
## functions are supported: starts_with, ends_with, has_substring, and
## one_of. Only the '=' operator is supported.
##
## The logical operators when combining filters are defined statically using
## the following values:
## filter ::= {AND AND AND }
## resource_labels ::= {OR }
## metric_labels ::= {OR }
## user_labels ::= {OR }
## system_labels ::= {OR }
##
## For more details, see https://cloud.google.com/monitoring/api/v3/filters
#
## Resource labels refine the time series selection with the following expression:
## resource.labels. =
# [[inputs.stackdriver.filter.resource_labels]]
# key = "instance_name"
# value = 'starts_with("localhost")'
#
## Metric labels refine the time series selection with the following expression:
## metric.labels. =
# [[inputs.stackdriver.filter.metric_labels]]
# key = "device_name"
# value = 'one_of("sda", "sdb")'
#
## User labels refine the time series selection with the following expression:
## metadata.user_labels."" =
# [[inputs.stackdriver.filter.user_labels]]
# key = "environment"
# value = 'one_of("prod", "staging")'
#
## System labels refine the time series selection with the following expression:
## metadata.system_labels."" =
# [[inputs.stackdriver.filter.system_labels]]
# key = "machine_type"
# value = 'starts_with("e2-")'
</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"
输入和输出集成示例
Google Cloud Stackdriver
-
将云指标集成到自定义仪表板中: 借助此插件,团队可以将来自 Google Cloud 的指标导入到个性化仪表板中,从而可以实时监控应用程序性能和资源利用率。 通过自定义云指标的可视化表示,运营团队可以轻松识别趋势和异常情况,从而在问题升级之前进行主动管理。
-
自动警报和分析: 用户可以设置自动警报机制,利用插件的指标来跟踪资源阈值。 这种功能使团队能够通过提供即时通知来对性能下降或中断做出快速响应,从而缩短平均恢复时间并确保持续的运营效率。
-
跨平台资源比较: 该插件可用于从各种 Google Cloud 服务中提取指标,并将其与本地资源进行比较。 这种跨平台可见性有助于组织就资源分配和扩展策略做出明智的决策,并优化云支出与本地基础设施。
-
用于容量规划的历史数据分析: 通过长期收集历史指标,该插件使团队能够进行全面的容量规划。 了解过去的性能趋势有助于准确预测资源需求,从而实现更好的预算和投资策略。
Cortex
-
统一的多租户监控: 使用 Telegraf 从不同的团队或环境中收集指标,并使用单独的 `X-Scope-OrgID` 标头将它们推送到 Cortex。 这实现了每个租户的隔离数据摄取和查询,非常适合托管服务和平台团队。
-
将 Prometheus 覆盖范围扩展到边缘设备: 在边缘或 IoT 设备上部署 Telegraf 以收集系统指标,并将它们发送到集中的 Cortex 集群。 即使对于没有本地 Prometheus 抓取器的环境,此方法也能确保一致的可观测性。
-
具有联合租户的全局服务可观测性: 通过配置 Telegraf 代理将数据推送到区域 Cortex 集群(每个集群都标有租户标识符),来聚合来自全局基础设施的指标。 Cortex 处理跨区域的重复数据删除和集中访问。
-
自定义应用程序遥测管道: 通过 Telegraf 的 `exec` 或 `http` 输入插件收集特定于应用程序的遥测数据,并将其转发到 Cortex。 这使 DevOps 团队能够以可扩展、查询高效的格式监控特定于应用程序的 KPI,同时保持指标按租户或服务进行逻辑分组。
反馈
感谢您成为我们社区的一份子! 如果您有任何一般反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。 请在 InfluxDB 社区 Slack 中提交您的反馈。
强大性能,无限扩展
收集、组织和处理海量高速数据。 当您将任何数据视为时间序列数据时,它会更有价值。 使用 InfluxDB(第一的时间序列平台),它旨在通过 Telegraf 进行扩展。
查看入门方法