目录
强大的性能,无限的扩展
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都会变得更有价值。InfluxDB 是排名第一的时间序列平台,旨在通过 Telegraf 进行扩展。
查看入门方法
输入和输出集成概述
使用 Azure Monitor API 从 Azure 资源收集指标。
Telegraf 的 SQL 插件有助于将指标存储在 SQL 数据库中。当配置为 Microsoft SQL Server 时,它支持特定的 DSN 格式和架构要求,从而实现与 SQL Server 的无缝集成。
集成详情
Azure Monitor
Azure Monitor Telegraf 插件专为使用 Azure Monitor API 从各种 Azure 资源收集指标而设计。用户必须提供特定的凭据,例如 client_id
、client_secret
、tenant_id
和 subscription_id
,以进行身份验证并获取对其 Azure 资源的访问权限。此外,该插件还支持从单个资源以及资源组或订阅收集指标的功能,从而可以灵活且可扩展地收集指标,以满足用户需求。此插件非常适合利用 Azure 云基础设施的组织,可深入了解资源性能和长期利用率,从而促进云资源的积极管理和优化。
Microsoft SQL Server
Telegraf 用于 Microsoft SQL Server 的 SQL 输出插件旨在通过动态创建与传入数据结构匹配的表和列来捕获和存储指标数据。此集成利用 go-mssqldb 驱动程序,该驱动程序通过包含服务器、端口和数据库详细信息的 DSN 遵循 SQL Server 连接协议。尽管该驱动程序由于单元测试有限而被认为是实验性的,但它为动态架构生成和数据插入提供了强大的支持,从而可以详细记录系统性能的时间戳记录。尽管其状态为实验性,但这种灵活性使其成为需要可靠且精细的指标日志记录的环境的宝贵工具。
配置
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>
Microsoft SQL Server
[[outputs.sql]]
## Database driver
## Valid options: mssql (Microsoft SQL Server), mysql (MySQL), pgx (Postgres),
## sqlite (SQLite3), snowflake (snowflake.com), clickhouse (ClickHouse)
driver = "mssql"
## Data source name
## For Microsoft SQL Server, the DSN typically includes the server, port, username, password, and database name.
## Example DSN: "sqlserver://username:password@localhost:1433?database=telegraf"
data_source_name = "sqlserver://username:password@localhost:1433?database=telegraf"
## Timestamp column name
timestamp_column = "timestamp"
## Table creation template
## Available template variables:
## {TABLE} - table name as a quoted identifier
## {TABLELITERAL} - table name as a quoted string literal
## {COLUMNS} - column definitions (list of quoted identifiers and types)
table_template = "CREATE TABLE {TABLE} ({COLUMNS})"
## Table existence check template
## Available template variables:
## {TABLE} - table name as a quoted identifier
table_exists_template = "SELECT 1 FROM {TABLE} LIMIT 1"
## Initialization SQL (optional)
init_sql = ""
## Maximum amount of time a connection may be idle. "0s" means connections are never closed due to idle time.
connection_max_idle_time = "0s"
## Maximum amount of time a connection may be reused. "0s" means connections are never closed due to age.
connection_max_lifetime = "0s"
## Maximum number of connections in the idle connection pool. 0 means unlimited.
connection_max_idle = 2
## Maximum number of open connections to the database. 0 means unlimited.
connection_max_open = 0
## Metric type to SQL type conversion
## You can customize the mapping if needed.
#[outputs.sql.convert]
# integer = "INT"
# real = "DOUBLE"
# text = "TEXT"
# timestamp = "TIMESTAMP"
# defaultvalue = "TEXT"
# unsigned = "UNSIGNED"
# bool = "BOOL"
输入和输出集成示例
Azure Monitor
-
动态资源监控:使用 Azure Monitor 插件根据特定条件(如标签或资源类型)动态收集 Azure 资源的指标。组织可以自动化加载和卸载资源指标的过程,从而根据资源利用率模式更好地跟踪和优化性能。
-
多云监控集成:使用集中式监控解决方案集成从 Azure Monitor 收集的指标与其他云提供商的指标。这使组织能够查看和分析跨多个云部署的性能数据,从而全面了解资源性能和成本,并简化运营。
-
异常检测和警报:利用通过 Azure Monitor 插件收集的指标,结合机器学习算法来检测资源利用率的异常情况。通过建立基准性能指标并自动发出偏差警报,组织可以在风险升级之前减轻风险并解决性能问题。
-
历史性能分析:通过将数据馈送到数据仓库解决方案中,使用收集的 Azure 指标进行历史分析。这使组织能够跟踪长期趋势,从而根据历史性能数据进行详细报告和决策。
Microsoft SQL Server
-
企业应用程序监控:利用该插件捕获在 SQL Server 上运行的企业应用程序的详细性能指标。此设置允许 IT 团队分析系统性能、跟踪事务时间并识别复杂多层环境中的瓶颈。
-
动态基础设施审计:部署该插件以在 SQL Server 中创建基础设施变更和性能指标的动态审计日志。对于需要实时监控和历史分析系统性能以实现合规性和优化的组织,此用例非常理想。
-
自动化性能基准测试:使用该插件持续记录和分析 SQL Server 数据库的性能指标。这支持自动化基准测试,将历史数据与当前性能进行比较,从而帮助快速识别服务中的异常或降级。
-
集成 DevOps 仪表板:将该插件与 DevOps 监控工具集成,以将 SQL Server 的实时指标馈送到集中式仪表板中。这提供了应用程序运行状况的整体视图,使团队可以将 SQL Server 性能与应用程序级事件相关联,从而更快地进行故障排除和主动维护。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现了任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。
强大的性能,无限的扩展
收集、组织和处理海量高速数据。当您将任何数据视为时间序列数据时,它都会变得更有价值。InfluxDB 是排名第一的时间序列平台,旨在通过 Telegraf 进行扩展。
查看入门方法