Aerospike

Aerospike 集成收集关键命名空间和系统指标,例如磁盘和内存用量、扫描数和连接数。此集成使用 Aerospike 提供的官方客户端 API 来收集这些指标。

如需详细了解 Aerospike,请参阅 Aerospike 文档

前提条件

如需收集 Aerospike 遥测数据,您必须安装 Ops Agent

  • 对于指标,请安装 2.18.2 版或更高版本。
  • 对于日志,请安装 2.23.0 版或更高版本。

此集成支持 Aerospike 4.9、5.x 和 6.x 版。

配置 Aerospike 实例

Aerospike 日志会在 Aerospike 作为 systemd 服务运行的系统上自动注入。在其他系统(如 SLES)上,您可以手动配置 files 接收器来接收 Aerospike 的日志文件,该文件通常位于 $HOME/aerospike-server/var/log/aerospike.log

为 Aerospike 配置 Ops Agent

按照配置 Ops Agent 指南,添加从 Aerospike 实例收集遥测数据所需的元素并重启代理

配置示例

以下命令会创建相关配置来收集和注入 Aerospike 的遥测数据,并重启 Ops Agent。

# Configures Ops Agent to collect telemetry from the app and restart Ops Agent.

set -e

# Create a back up of the existing file so existing configurations are not lost.
sudo cp /etc/google-cloud-ops-agent/config.yaml /etc/google-cloud-ops-agent/config.yaml.bak

# Configure the Ops Agent.
sudo tee /etc/google-cloud-ops-agent/config.yaml > /dev/null << EOF
metrics:
  receivers:
    aerospike:
      type: aerospike
  service:
    pipelines:
      aerospike:
        receivers:
          - aerospike
EOF

sudo service google-cloud-ops-agent restart
sleep 30

收集日志

Aerospike 会将日志写入 syslog,默认情况下由 Ops Agent 捕获。无需进行额外的用户配置。

配置指标收集

如需从 Aerospike 注入指标,您必须为 Aerospike 生成的指标创建接收器,然后为新的接收器创建流水线。

此接收器不支持在配置中使用多个实例,例如,监控多个端点。所有这些实例都会写入相同的时序,并且 Cloud Monitoring 无法区分它们。

如需为 aerospike 指标配置接收器,请指定以下字段:

字段 默认 说明
collect_cluster_metrics true 配置接收器以从 Aerospike 系统的对等节点收集指标。
collection_interval 60s time.Duration 值,例如 30s5m
endpoint localhost:3000 Aerospike 系统的地址,格式为 host:port。
password 将 Aerospike 配置为需要身份验证时配置的密码。
timeout 20s 对 Aerospike 系统的请求超时,即 time.Duration 值,例如 30s5m
type aerospike 该值必须为 aerospike
username 将 Aerospike 配置为需要身份验证时配置的用户名。

监控的内容

下表提供了 Ops Agent 从 Aerospike 实例收集的指标列表。

指标类型
种类、类型
受监控的资源
标签
workload.googleapis.com/aerospike.namespace.disk.available
GAUGEINT64
gce_instance
node_name
namespace_name
workload.googleapis.com/aerospike.namespace.memory.free
GAUGEINT64
gce_instance
node_name
namespace_name
workload.googleapis.com/aerospike.namespace.memory.usage
GAUGEINT64
gce_instance
component
node_name
namespace_name
workload.googleapis.com/aerospike.namespace.scan.count
CUMULATIVEINT64
gce_instance
result
type
node_name
namespace_name
workload.googleapis.com/aerospike.namespace.transaction.count
CUMULATIVEINT64
gce_instance
result
type
node_name
namespace_name
workload.googleapis.com/aerospike.node.connection.count
CUMULATIVEINT64
gce_instance
operation
type
node_name
workload.googleapis.com/aerospike.node.connection.open
GAUGEINT64
gce_instance
type
node_name
workload.googleapis.com/aerospike.node.memory.free
GAUGEINT64
gce_instance
node_name

验证配置

本部分介绍如何验证您是否正确配置了 Aerospike 接收器。Ops Agent 可能需要一两分钟才会开始收集遥测数据。

如需验证 Aerospike 日志是否已发送到 Cloud Logging,请执行以下操作:

  1. 在 Google Cloud 控制台中,转到 Logs Explorer 页面。

    前往 Logs Explorer

    如果您使用搜索栏查找此页面,请选择子标题为 Logging 的结果。

  2. 在编辑器中输入以下查询,然后点击运行查询
    resource.type="gce_instance"
    log_id("syslog")
    jsonPayload.message~=' asd([[0-9]+])*:'
    

如需验证 Aerospike 指标是否已发送到 Cloud Monitoring,请执行以下操作:

  1. 在 Google Cloud 控制台中,转到 Metrics Explorer 页面:

    进入 Metrics Explorer

    如果您使用搜索栏查找此页面,请选择子标题为监控的结果。

  2. 在查询构建器窗格的工具栏中,选择名为  MQL PromQL 的按钮。
  3. 验证已在语言切换开关中选择 MQL。语言切换开关位于同一工具栏中,用于设置查询的格式。
  4. 在编辑器中输入以下查询,然后点击运行查询
    fetch gce_instance
    | metric 'workload.googleapis.com/aerospike.node.connection.open'
    | every 1m
    

查看信息中心

如需查看 Aerospike 指标,您必须配置一个图表或信息中心。 Aerospike 集成服务可为您提供一个或多个信息中心。在您配置集成并且 Ops Agent 开始收集指标数据后,所有信息中心都会自动安装。

您还可以在不安装集成的情况下查看信息中心的静态预览。

如需查看已安装的信息中心,请执行以下操作:

  1. 在 Google Cloud 控制台中,转到 信息中心页面:

    前往信息中心

    如果您使用搜索栏查找此页面,请选择子标题为监控的结果。

  2. 选择信息中心列表标签页,然后选择集成类别。
  3. 点击您要查看的信息中心的名称。

如果您已配置集成,但尚未安装信息中心,请检查 Ops Agent 是否正在运行。如果信息中心内没有图表的指标数据,则信息中心的安装将失败。Ops Agent 开始收集指标后,系统会为您安装信息中心。

如需查看信息中心的静态预览,请执行以下操作:

  1. 在 Google Cloud 控制台中,转到 集成页面:

    前往集成

    如果您使用搜索栏查找此页面,请选择子标题为监控的结果。

  2. 点击 Compute Engine 部署平台过滤条件。
  3. 找到 Aerospike 条目,然后点击查看详细信息
  4. 选择信息中心标签页以查看静态预览。如果信息中心已安装,您可以通过点击查看信息中心来转到信息中心。

如需详细了解 Cloud Monitoring 中的信息中心,请参阅信息中心和图表

如需详细了解如何使用集成页面,请参阅管理集成

安装提醒政策

提醒政策会指示 Cloud Monitoring 在满足指定条件时通知您。 Aerospike 集成包含一项或多项提醒政策供您使用。您可以从 Monitoring 中的集成页面查看和安装这些提醒政策。

如需查看可用提醒政策的说明并安装它们,请执行以下操作:

  1. 在 Google Cloud 控制台中,转到 集成页面:

    前往集成

    如果您使用搜索栏查找此页面,请选择子标题为监控的结果。

  2. 找到 Aerospike 条目,然后点击查看详细信息
  3. 选择提醒标签页。此标签页提供可用提醒政策的说明,并提供一个安装政策的界面。
  4. 安装提醒政策。提醒政策需要知道将提醒触发的通知发送到何处,因此它们需要您提供信息才能进行安装。如需安装提醒政策,请执行以下操作:
    1. 从可用提醒政策列表中,选择您要安装的提醒政策。
    2. 配置通知部分中,选择一个或多个通知渠道。您可以选择禁止使用通知渠道,但如果您这样做,则您的提醒政策将以静默方式触发。您可以在 Monitoring 中查看其状态,但不会收到通知。

      如需详细了解通知渠道,请参阅管理通知渠道

    3. 点击创建政策

如需详细了解 Cloud Monitoring 中的提醒政策,请参阅提醒简介

如需详细了解如何使用集成页面,请参阅管理集成

后续步骤

如需查看如何使用 Ansible 安装 Ops Agent、配置第三方应用和安装示例信息中心的演示,请参阅安装 Ops Agent 以排查第三方应用的问题视频。