目录
输入和输出集成概述
Telegraf 的 Ceph 插件有助于从 Ceph 存储集群中的 MON 和 OSD 节点收集性能指标,以实现有效的监控和管理。
Telegraf Elasticsearch 插件无缝地将指标发送到 Elasticsearch 服务器。该插件处理模板创建和动态索引管理,并支持各种 Elasticsearch 特有功能,以确保数据格式正确,以便存储和检索。
集成详情
Ceph
Ceph Storage Telegraf 插件旨在从 Ceph 存储集群中的 Monitor (MON) 和 Object Storage Daemon (OSD) 节点收集性能指标。Ceph 是一个高度可扩展的存储系统,通过此插件集成其指标收集,从而方便地监控其组件。随着 13.x Mimic 版本中引入此插件,用户可以有效地收集有关其 Ceph 基础设施的性能和运行状况的详细见解。它的工作原理是扫描配置的套接字目录以查找特定的 Ceph 服务套接字文件,通过 Ceph 管理界面执行命令,并解析返回的 JSON 数据以获取指标。指标基于顶级键进行组织,从而可以有效地监控和分析集群性能。该插件通过允许管理员了解系统行为并主动识别潜在问题,为管理和维护 Ceph 集群的性能提供了有价值的功能。
Elasticsearch
此插件将指标写入 Elasticsearch,Elasticsearch 是一个分布式、RESTful 的搜索和分析引擎,能够近乎实时地存储大量数据。它旨在处理 Elasticsearch 5.x 到 7.x 版本,并利用其动态模板功能来正确管理数据类型映射。该插件支持高级功能,例如模板管理、动态索引命名以及与 OpenSearch 的集成。它还允许配置 Elasticsearch 节点的身份验证和健康监控。
配置
Ceph
[[inputs.ceph]]
## This is the recommended interval to poll. Too frequent and you
## will lose data points due to timeouts during rebalancing and recovery
interval = '1m'
## All configuration values are optional, defaults are shown below
## location of ceph binary
ceph_binary = "/usr/bin/ceph"
## directory in which to look for socket files
socket_dir = "/var/run/ceph"
## prefix of MON and OSD socket files, used to determine socket type
mon_prefix = "ceph-mon"
osd_prefix = "ceph-osd"
mds_prefix = "ceph-mds"
rgw_prefix = "ceph-client"
## suffix used to identify socket files
socket_suffix = "asok"
## Ceph user to authenticate as, ceph will search for the corresponding
## keyring e.g. client.admin.keyring in /etc/ceph, or the explicit path
## defined in the client section of ceph.conf for example:
##
## [client.telegraf]
## keyring = /etc/ceph/client.telegraf.keyring
##
## Consult the ceph documentation for more detail on keyring generation.
ceph_user = "client.admin"
## Ceph configuration to use to locate the cluster
ceph_config = "/etc/ceph/ceph.conf"
## Whether to gather statistics via the admin socket
gather_admin_socket_stats = true
## Whether to gather statistics via ceph commands, requires ceph_user
## and ceph_config to be specified
gather_cluster_stats = false
Elasticsearch
[[outputs.elasticsearch]]
## The full HTTP endpoint URL for your Elasticsearch instance
## Multiple urls can be specified as part of the same cluster,
## this means that only ONE of the urls will be written to each interval
urls = [ "http://node1.es.example.com:9200" ] # required.
## Elasticsearch client timeout, defaults to "5s" if not set.
timeout = "5s"
## Set to true to ask Elasticsearch a list of all cluster nodes,
## thus it is not necessary to list all nodes in the urls config option
enable_sniffer = false
## Set to true to enable gzip compression
enable_gzip = false
## Set the interval to check if the Elasticsearch nodes are available
## Setting to "0s" will disable the health check (not recommended in production)
health_check_interval = "10s"
## Set the timeout for periodic health checks.
# health_check_timeout = "1s"
## HTTP basic authentication details.
## HTTP basic authentication details
# username = "telegraf"
# password = "mypassword"
## HTTP bearer token authentication details
# auth_bearer_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9"
## Index Config
## The target index for metrics (Elasticsearch will create if it not exists).
## You can use the date specifiers below to create indexes per time frame.
## The metric timestamp will be used to decide the destination index name
# %Y - year (2016)
# %y - last two digits of year (00..99)
# %m - month (01..12)
# %d - day of month (e.g., 01)
# %H - hour (00..23)
# %V - week of the year (ISO week) (01..53)
## Additionally, you can specify a tag name using the notation {{tag_name}}
## which will be used as part of the index name. If the tag does not exist,
## the default tag value will be used.
# index_name = "telegraf-{{host}}-%Y.%m.%d"
# default_tag_value = "none"
index_name = "telegraf-%Y.%m.%d" # required.
## Optional Index Config
## Set to true if Telegraf should use the "create" OpType while indexing
# use_optype_create = false
## Optional TLS Config
# 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
## Template Config
## Set to true if you want telegraf to manage its index template.
## If enabled it will create a recommended index template for telegraf indexes
manage_template = true
## The template name used for telegraf indexes
template_name = "telegraf"
## Set to true if you want telegraf to overwrite an existing template
overwrite_template = false
## If set to true a unique ID hash will be sent as sha256(concat(timestamp,measurement,series-hash)) string
## it will enable data resend and update metric points avoiding duplicated metrics with different id's
force_document_id = false
## Specifies the handling of NaN and Inf values.
## This option can have the following values:
## none -- do not modify field-values (default); will produce an error if NaNs or infs are encountered
## drop -- drop fields containing NaNs or infs
## replace -- replace with the value in "float_replacement_value" (default: 0.0)
## NaNs and inf will be replaced with the given number, -inf with the negative of that number
# float_handling = "none"
# float_replacement_value = 0.0
## Pipeline Config
## To use a ingest pipeline, set this to the name of the pipeline you want to use.
# use_pipeline = "my_pipeline"
## Additionally, you can specify a tag name using the notation {{tag_name}}
## which will be used as part of the pipeline name. If the tag does not exist,
## the default pipeline will be used as the pipeline. If no default pipeline is set,
## no pipeline is used for the metric.
# use_pipeline = "{{es_pipeline}}"
# default_pipeline = "my_pipeline"
#
# Custom HTTP headers
# To pass custom HTTP headers please define it in a given below section
# [outputs.elasticsearch.headers]
# "X-Custom-Header" = "custom-value"
## Template Index Settings
## Overrides the template settings.index section with any provided options.
## Defaults provided here in the config
# template_index_settings = {
# refresh_interval = "10s",
# mapping.total_fields.limit = 5000,
# auto_expand_replicas = "0-1",
# codec = "best_compression"
# }
输入和输出集成示例
Ceph
-
动态监控仪表板:利用 Ceph 插件创建一个实时监控仪表板,以可视化方式表示 Ceph 集群的性能指标。通过将这些指标集成到集中式仪表板中,系统管理员可以立即了解存储基础设施的运行状况,这有助于快速识别和解决潜在问题,防止问题升级。
-
自动化警报系统:将 Ceph 插件与警报解决方案结合使用,以自动通知管理员 Ceph 集群内的性能下降或操作问题。通过为关键指标定义阈值,组织可以确保及时响应操作,从而提高整体系统可靠性和性能。
-
性能基准测试:使用此插件收集的指标,在 Ceph 存储集群的不同配置或硬件设置中进行性能基准测试。此过程可以帮助组织识别优化配置,从而提高性能和资源利用率,从而促进更高效的存储环境。
-
容量规划和预测:将从 Ceph 存储插件收集的指标集成到更广泛的数据分析和报告工具中,以促进容量规划。通过分析历史指标,组织可以预测未来的利用率趋势,从而就有效扩展存储资源做出明智的决策。
Elasticsearch
-
基于时间的索引:使用此插件将指标存储在 Elasticsearch 中,以根据收集时间索引每个指标。例如,CPU 指标可以存储在名为
telegraf-2023.01.01
的每日索引中,从而可以轻松进行基于时间的查询和保留策略。 -
动态模板管理:利用模板管理功能自动创建针对您的指标定制的自定义模板。这允许您定义如何索引和分析不同的字段,而无需手动配置 Elasticsearch,从而确保用于查询的最佳数据结构。
-
OpenSearch 兼容性:如果您正在使用 AWS OpenSearch,您可以配置此插件通过激活兼容模式来无缝工作,确保您现有的 Elasticsearch 客户端保持功能并与较新的集群设置兼容。
反馈
感谢您成为我们社区的一份子!如果您有任何一般性反馈或在这些页面上发现任何错误,我们欢迎并鼓励您提出意见。请在 InfluxDB 社区 Slack 中提交您的反馈。