目录
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都更有价值。借助 InfluxDB,这是排名第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法
输入和输出集成概述
使用 Azure Monitor API 从 Azure 资源收集指标。
Telegraf PostgreSQL 插件允许您高效地将指标写入 PostgreSQL 数据库,同时自动管理数据库架构。
集成详情
Azure Monitor
Azure Monitor Telegraf 插件专为使用 Azure Monitor API 从各种 Azure 资源收集指标而设计。用户必须提供特定的凭据,例如 client_id
、client_secret
、tenant_id
和 subscription_id
,以进行身份验证并访问其 Azure 资源。此外,该插件还支持从单个资源和资源组或订阅收集指标的功能,从而实现根据用户需求灵活且可扩展的指标收集。此插件非常适合利用 Azure 云基础设施的组织,可以深入了解资源性能和长期利用率,从而促进云资源的积极管理和优化。
PostgreSQL
PostgreSQL 插件使用户能够将指标写入 PostgreSQL 数据库或兼容的数据库,通过自动更新缺失的列来为架构管理提供强大的支持。该插件旨在促进与监控解决方案的集成,使用户能够高效地存储和管理时间序列数据。它为连接设置、并发和错误处理提供了可配置的选项,并支持高级功能,例如用于标签和字段的 JSONB 存储、外键标记、模板化架构修改以及通过 pguint 扩展支持无符号整数数据类型。
配置
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>
PostgreSQL
# Publishes metrics to a postgresql database
[[outputs.postgresql]]
## Specify connection address via the standard libpq connection string:
## host=... user=... password=... sslmode=... dbname=...
## Or a URL:
## postgres://[user[:password]]@localhost[/dbname]?sslmode=[disable|verify-ca|verify-full]
## See https://postgresql.ac.cn/docs/current/libpq-connect.html#LIBPQ-CONNSTRING
##
## All connection parameters are optional. Environment vars are also supported.
## e.g. PGPASSWORD, PGHOST, PGUSER, PGDATABASE
## All supported vars can be found here:
## https://postgresql.ac.cn/docs/current/libpq-envars.html
##
## Non-standard parameters:
## pool_max_conns (default: 1) - Maximum size of connection pool for parallel (per-batch per-table) inserts.
## pool_min_conns (default: 0) - Minimum size of connection pool.
## pool_max_conn_lifetime (default: 0s) - Maximum age of a connection before closing.
## pool_max_conn_idle_time (default: 0s) - Maximum idle time of a connection before closing.
## pool_health_check_period (default: 0s) - Duration between health checks on idle connections.
# connection = ""
## Postgres schema to use.
# schema = "public"
## Store tags as foreign keys in the metrics table. Default is false.
# tags_as_foreign_keys = false
## Suffix to append to table name (measurement name) for the foreign tag table.
# tag_table_suffix = "_tag"
## Deny inserting metrics if the foreign tag can't be inserted.
# foreign_tag_constraint = false
## Store all tags as a JSONB object in a single 'tags' column.
# tags_as_jsonb = false
## Store all fields as a JSONB object in a single 'fields' column.
# fields_as_jsonb = false
## Name of the timestamp column
## NOTE: Some tools (e.g. Grafana) require the default name so be careful!
# timestamp_column_name = "time"
## Type of the timestamp column
## Currently, "timestamp without time zone" and "timestamp with time zone"
## are supported
# timestamp_column_type = "timestamp without time zone"
## Templated statements to execute when creating a new table.
# create_templates = [
# '''CREATE TABLE {{ .table }} ({{ .columns }})''',
# ]
## Templated statements to execute when adding columns to a table.
## Set to an empty list to disable. Points containing tags for which there is no column will be skipped. Points
## containing fields for which there is no column will have the field omitted.
# add_column_templates = [
# '''ALTER TABLE {{ .table }} ADD COLUMN IF NOT EXISTS {{ .columns|join ", ADD COLUMN IF NOT EXISTS " }}''',
# ]
## Templated statements to execute when creating a new tag table.
# tag_table_create_templates = [
# '''CREATE TABLE {{ .table }} ({{ .columns }}, PRIMARY KEY (tag_id))''',
# ]
## Templated statements to execute when adding columns to a tag table.
## Set to an empty list to disable. Points containing tags for which there is no column will be skipped.
# tag_table_add_column_templates = [
# '''ALTER TABLE {{ .table }} ADD COLUMN IF NOT EXISTS {{ .columns|join ", ADD COLUMN IF NOT EXISTS " }}''',
# ]
## The postgres data type to use for storing unsigned 64-bit integer values (Postgres does not have a native
## unsigned 64-bit integer type).
## The value can be one of:
## numeric - Uses the PostgreSQL "numeric" data type.
## uint8 - Requires pguint extension (https://github.com/petere/pguint)
# uint64_type = "numeric"
## When using pool_max_conns>1, and a temporary error occurs, the query is retried with an incremental backoff. This
## controls the maximum backoff duration.
# retry_max_backoff = "15s"
## Approximate number of tag IDs to store in in-memory cache (when using tags_as_foreign_keys).
## This is an optimization to skip inserting known tag IDs.
## Each entry consumes approximately 34 bytes of memory.
# tag_cache_size = 100000
## Enable & set the log level for the Postgres driver.
# log_level = "warn" # trace, debug, info, warn, error, none
输入和输出集成示例
Azure Monitor
-
动态资源监控:使用 Azure Monitor 插件根据特定标准(如标签或资源类型)动态收集 Azure 资源的指标。组织可以自动化加载和卸载资源指标的过程,从而根据资源利用率模式更好地进行性能跟踪和优化。
-
多云监控集成:使用集中式监控解决方案将从 Azure Monitor 收集的指标与其他云提供商集成。这使组织能够查看和分析跨多个云部署的性能数据,从而全面了解资源性能和成本,并简化运营。
-
异常检测和警报:结合机器学习算法,利用通过 Azure Monitor 插件收集的指标来检测资源利用率中的异常。通过建立基线性能指标并自动警报偏差,组织可以降低风险并在性能问题升级之前解决它们。
-
历史性能分析:通过将数据馈送到数据仓库解决方案中,使用收集的 Azure 指标进行历史分析。这使组织能够跟踪随时间变化的趋势,从而根据历史性能数据进行详细的报告和决策。
PostgreSQL
-
使用复杂查询进行实时分析:利用 PostgreSQL 插件将来自各种来源的指标存储在 PostgreSQL 数据库中,从而使用复杂查询实现实时分析。这种设置可以帮助数据科学家和分析师发现模式和趋势,因为他们可以在利用 PostgreSQL 强大的查询优化功能的同时,跨多个表操作关系数据。具体来说,用户可以使用跨不同指标表的 JOIN 操作创建复杂的报告,从而揭示通常隐藏在嵌入式系统中的见解。
-
与 TimescaleDB 集成以处理时间序列数据:在 TimescaleDB 实例中使用 PostgreSQL 插件来高效地处理和分析时间序列数据。通过实施超表,用户可以在时间维度上实现更高的性能和主题分区。这种集成允许用户对大量时间序列数据运行分析查询,同时保留 PostgreSQL SQL 查询的全部功能,从而确保指标分析的可靠性和效率。
-
数据版本控制和历史分析:实施一种使用 PostgreSQL 插件来维护指标随时间推移的不同版本的策略。用户可以设置一个不可变的数据表结构,其中保留表的旧版本,从而轻松进行历史分析。这种方法不仅可以深入了解数据演变,还可以帮助遵守数据保留策略,确保数据集的历史完整性保持不变。
-
动态架构管理以适应不断变化的指标:使用插件的模板功能创建动态变化的架构,以响应指标变化。此用例允许组织在指标演变时调整其数据结构,添加必要的字段并确保遵守数据完整性策略。通过利用模板化的 SQL 命令,用户无需手动干预即可扩展其数据库,从而促进敏捷的数据管理实践。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展能力
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都更有价值。借助 InfluxDB,这是排名第一的时间序列平台,旨在与 Telegraf 一起扩展。
查看入门方法