配置 SAP HANA 监控指标收集

本指南介绍如何配置 Google Cloud的 Agent for SAP 以从 SAP HANA 系统收集 SAP HANA 监控指标。

如需了解此功能,请参阅使用 Google Cloud的 Agent for SAP 监控 SAP HANA

准备工作

设置 IAM 角色

如需允许 Google Cloud的 Agent for SAP 收集 SAP HANA 监控指标,您必须确保 Compute Engine 实例或裸金属解决方案服务器使用的服务账号包含以下角色:

如需向您的服务账号添加这些必需的角色,请按照以下步骤操作:

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

    转到 IAM

  2. 选择您的 Google Cloud 项目。

  3. 确定要向其添加角色的服务账号。

    • 如果该服务账号不在主账号列表中,则表明还没有为它分配任何角色。点击添加,然后输入该服务账号的电子邮件地址。
    • 如果该服务账号已经在主账号列表中,则表明它已具有角色。点击要修改的服务账号对应的修改按钮。
  4. 从可用角色列表中选择所需角色:

    • Compute Viewer
    • Monitoring > Monitoring Metric Writer
    • Secret Manager > Secret Manager Secret Accessor
  5. 点击添加保存,将相应角色应用于该服务账号。

如需精细控制访问权限,您可以为自己的自定义角色设置以下 IAM 权限:

  • 指标收集:
    • monitoring.timeSeries.create
  • Secret Manager:
    • secretmanager.versions.access

如需详细了解如何创建自定义角色,请参阅创建和管理自定义角色

启用 SAP HANA 监控指标收集功能

如需启用使用Google Cloud的 Agent for SAP 收集 SAP HANA 监控指标的功能,请按照以下步骤操作:

  1. 与 Compute Engine 实例或裸金属解决方案服务器建立 SSH 连接。

  2. 打开代理的配置文件:

    /etc/google-cloud-sap-agent/configuration.json

    或者,您也可以通过运行命令来执行此配置。如需了解详情,请参阅 Google Cloud的 Agent for SAP 的配置命令

  3. hana_monitoring_configuration 部分中,执行以下操作:

    • 对于参数 enabled,设置值 true
    • hana_instances 部分中,指定您希望代理监控的 SAP HANA 实例。
    • (可选)定义自定义查询。如需了解如何定义自定义查询并查看示例,请参阅定义自定义查询
    • (可选)停用内置查询或默认查询。如需查看相关说明,请参阅停用 SQL 查询

      如需了解配置参数,请参阅配置参数

  4. (可选)在 cloud_properties 部分下,您可以更新自动设置的参数值。为此,请将 cloud_properties 部分添加到您的配置文件中,然后指定必需的参数及其值。

  5. 保存配置文件。

  6. 重启代理以使新设置生效:

    sudo systemctl restart google-cloud-sap-agent

配置文件示例

Compute Engine 实例

以下示例是在Compute Engine 实例上运行的Google Cloud的 Agent for SAP(其中启用了 SAP HANA 监控指标的收集功能)的已完成配置文件。请注意,这些示例中包含的自定义查询(名为 custom_query)遵循定义自定义查询中指定的自定义查询定义准则。

以下示例使用安全用户存储区 (hdbuserstore) 密钥进行 SAP HANA 身份验证:

{
  "provide_sap_host_agent_metrics": true,
  "bare_metal": false,
  "log_level": "INFO",
  "log_to_cloud": true,
  "collection_configuration": {
    "collect_workload_validation_metrics": true,
    "collect_process_metrics": false
  },
  "cloud_properties": {
    "project_id": "my-project",
    "instance_name": "instance-1",
    "image": "rhel-8"
  },
  "discovery_configuration": {
    "enable_discovery": true,
    "enable_workload_discovery": true
  },
  "hana_monitoring_configuration": {
    "enabled": true,
    "sample_interval_sec": 60,
    "query_timeout_sec": 30,
    "execution_threads": 20,
    "hana_instances": [
      {
        "name": "local",
        "sid": "DEH",
        "user": "system",
        "hdbuserstore_key": "user_store_key"
      },
      {
        "name": "remote",
        "sid": "DEH",
        "user": "system",
        "hdbuserstore_key": "user_store_key"
      }
    ],
    "queries": [
      {
        "name": "custom_query",
        "enabled": true,
        "sql": "SELECT * FROM MyTable;",
        "columns": [
          {
            "name": "string",
            "metric_type": "METRIC_LABEL",
            "value_type": "VALUE_STRING"
          },
          {
            "name": "bool",
            "metric_type": "METRIC_GAUGE",
            "value_type": "VALUE_BOOL"
          },
          {
            "name": "int",
            "metric_type": "METRIC_GAUGE",
            "value_type": "VALUE_INT64"
          },
          {
            "name": "double",
            "metric_type": "METRIC_GAUGE",
            "value_type": "VALUE_DOUBLE"
          }
        ]
      },
      {
        "name": "default_host_queries",
        "enabled": false
      }
    ]
  }
}

以下示例使用用户名和 Secret Manager Secret 进行 SAP HANA 身份验证:

{
  "provide_sap_host_agent_metrics": true,
  "bare_metal": false,
  "log_level": "INFO",
  "log_to_cloud": true,
  "collection_configuration": {
    "collect_workload_validation_metrics": true,
    "collect_process_metrics": false
  },
  "cloud_properties": {
    "project_id": "my-project",
    "instance_name": "instance-1",
    "image": "rhel-8"
  },
  "discovery_configuration": {
    "enable_discovery": true,
    "enable_workload_discovery": true
  },
  "hana_monitoring_configuration": {
    "enabled": true,
    "sample_interval_sec": 60,
    "query_timeout_sec": 30,
    "execution_threads": 20,
    "hana_instances": [
      {
        "name": "local",
        "sid": "DEH",
        "host": "localhost",
        "port": "30015",
        "user": "system",
        "secret_name": "password-secret-name"
      },
      {
        "name": "remote",
        "sid": "DEH",
        "host": "10.123.0.12",
        "port": "30015",
        "user": "system",
        "secret_name": "password-secret-name"
      }
    ],
    "queries": [
      {
        "name": "custom_query",
        "enabled": true,
        "sql": "SELECT * FROM MyTable;",
        "columns": [
          {
            "name": "string",
            "metric_type": "METRIC_LABEL",
            "value_type": "VALUE_STRING"
          },
          {
            "name": "bool",
            "metric_type": "METRIC_GAUGE",
            "value_type": "VALUE_BOOL"
          },
          {
            "name": "int",
            "metric_type": "METRIC_GAUGE",
            "value_type": "VALUE_INT64"
          },
          {
            "name": "double",
            "metric_type": "METRIC_GAUGE",
            "value_type": "VALUE_DOUBLE"
          }
        ]
      },
      {
        "name": "default_host_queries",
        "enabled": false
      }
    ]
  }
}

以下示例使用用户名和密码进行 SAP HANA 身份验证。我们建议您改用 Secret Manager 密钥或安全用户存储区 (hdbuserstore) 密钥进行 SAP HANA 身份验证。

{
  "provide_sap_host_agent_metrics": true,
  "bare_metal": false,
  "log_level": "INFO",
  "log_to_cloud": true,
  "collection_configuration": {
    "collect_workload_validation_metrics": true,
    "collect_process_metrics": false
  },
  "cloud_properties": {
    "project_id": "my-project",
    "instance_name": "instance-1",
    "image": "rhel-8"
  },
  "discovery_configuration": {
    "enable_discovery": true,
    "enable_workload_discovery": true
  },
  "hana_monitoring_configuration": {
    "enabled": true,
    "sample_interval_sec": 60,
    "query_timeout_sec": 30,
    "execution_threads": 20,
    "hana_instances": [
      {
        "name": "local",
        "sid": "DEH",
        "host": "localhost",
        "port": "30015",
        "user": "system",
        "password": "TempPa55word"
      },
      {
        "name": "remote",
        "sid": "DEH",
        "host": "10.123.0.12",
        "port": "30015",
        "user": "system",
        "password": "TempPa55word"
      }
    ],
    "queries": [
      {
        "name": "custom_query",
        "enabled": true,
        "sql": "SELECT * FROM MyTable;",
        "columns": [
          {
            "name": "string",
            "metric_type": "METRIC_LABEL",
            "value_type": "VALUE_STRING"
          },
          {
            "name": "bool",
            "metric_type": "METRIC_GAUGE",
            "value_type": "VALUE_BOOL"
          },
          {
            "name": "int",
            "metric_type": "METRIC_GAUGE",
            "value_type": "VALUE_INT64"
          },
          {
            "name": "double",
            "metric_type": "METRIC_GAUGE",
            "value_type": "VALUE_DOUBLE"
          }
        ]
      },
      {
        "name": "default_host_queries",
        "enabled": false
      }
    ]
  }
}

裸金属解决方案服务器

以下示例是在裸金属解决方案服务器上运行的Google Cloud的 Agent for SAP(其中启用了 SAP HANA 监控指标的收集功能)的已完成配置文件。请注意,这些示例中包含的自定义查询(名为 custom_query)遵循定义自定义查询中指定的自定义查询定义准则。

以下示例使用安全用户存储区 (hdbuserstore) 密钥进行 SAP HANA 身份验证:

{
  "provide_sap_host_agent_metrics": true,
  "bare_metal": true,
  "log_level": "INFO",
  "log_to_cloud": true,
  "collection_configuration": {
    "collect_workload_validation_metrics": true,
    "collect_process_metrics": false
  },
  "cloud_properties": {
    "project_id": "my-project",
    "instance_name": "bms-machine-1"
"region": "us-central1", "image": "rhel-8" }, "discovery_configuration": { "enable_discovery": true, "enable_workload_discovery": true }, "hana_monitoring_configuration": { "enabled": true, "sample_interval_sec": 60, "query_timeout_sec": 30, "execution_threads": 20, "hana_instances": [ { "name": "local", "sid": "DEH", "user": "system", "hdbuserstore_key": "user_store_key" }, { "name": "remote", "sid": "DEH", "user": "system", "hdbuserstore_key": "user_store_key" } ], "queries": [ { "name": "custom_query", "enabled": true, "sql": "SELECT * FROM MyTable;", "columns": [ { "name": "string", "metric_type": "METRIC_LABEL", "value_type": "VALUE_STRING" }, { "name": "bool", "metric_type": "METRIC_GAUGE", "value_type": "VALUE_BOOL" }, { "name": "int", "metric_type": "METRIC_GAUGE", "value_type": "VALUE_INT64" }, { "name": "double", "metric_type": "METRIC_GAUGE", "value_type": "VALUE_DOUBLE" } ] }, { "name": "default_host_queries", "enabled": false } ] } }

以下示例使用用户名和 Secret Manager Secret 进行 SAP HANA 身份验证:

{
  "provide_sap_host_agent_metrics": true,
  "bare_metal": true,
  "log_level": "INFO",
  "log_to_cloud": true,
  "collection_configuration": {
    "collect_workload_validation_metrics": true,
    "collect_process_metrics": false
  },
  "cloud_properties": {
    "project_id": "my-project",
    "instance_name": "bms-machine-1"
"region": "us-central1", "image": "rhel-8" }, "discovery_configuration": { "enable_discovery": true, "enable_workload_discovery": true }, "hana_monitoring_configuration": { "enabled": true, "sample_interval_sec": 60, "query_timeout_sec": 30, "execution_threads": 20, "hana_instances": [ { "name": "local", "sid": "DEH", "host": "localhost", "port": "30015", "user": "system", "secret_name": "password-secret-name" }, { "name": "remote", "sid": "DEH", "host": "10.123.0.12", "port": "30015", "user": "system", "secret_name": "password-secret-name" } ], "queries": [ { "name": "custom_query", "enabled": true, "sql": "SELECT * FROM MyTable;", "columns": [ { "name": "string", "metric_type": "METRIC_LABEL", "value_type": "VALUE_STRING" }, { "name": "bool", "metric_type": "METRIC_GAUGE", "value_type": "VALUE_BOOL" }, { "name": "int", "metric_type": "METRIC_GAUGE", "value_type": "VALUE_INT64" }, { "name": "double", "metric_type": "METRIC_GAUGE", "value_type": "VALUE_DOUBLE" } ] }, { "name": "default_host_queries", "enabled": false } ] } }

以下示例使用用户名和密码进行 SAP HANA 身份验证。我们建议您改用 Secret Manager 密钥或安全用户存储区 (hdbuserstore) 密钥进行 SAP HANA 身份验证。

{
  "provide_sap_host_agent_metrics": true,
  "bare_metal": true,
  "log_level": "INFO",
  "log_to_cloud": true,
  "collection_configuration": {
    "collect_workload_validation_metrics": true,
    "collect_process_metrics": false
  },
  "cloud_properties": {
    "project_id": "my-project",
    "instance_name": "bms-machine-1"
"region": "us-central1", "image": "rhel-8" }, "discovery_configuration": { "enable_discovery": true, "enable_workload_discovery": true }, "hana_monitoring_configuration": { "enabled": true, "sample_interval_sec": 60, "query_timeout_sec": 30, "execution_threads": 20, "hana_instances": [ { "name": "local", "sid": "DEH", "host": "localhost", "port": "30015", "user": "system", "password": "TempPa55word" }, { "name": "remote", "sid": "DEH", "host": "10.123.0.12", "port": "30015", "user": "system", "password": "TempPa55word" } ], "queries": [ { "name": "custom_query", "enabled": true, "sql": "SELECT * FROM MyTable;", "columns": [ { "name": "string", "metric_type": "METRIC_LABEL", "value_type": "VALUE_STRING" }, { "name": "bool", "metric_type": "METRIC_GAUGE", "value_type": "VALUE_BOOL" }, { "name": "int", "metric_type": "METRIC_GAUGE", "value_type": "VALUE_INT64" }, { "name": "double", "metric_type": "METRIC_GAUGE", "value_type": "VALUE_DOUBLE" } ] }, { "name": "default_host_queries", "enabled": false } ] } }

定义自定义 SQL 查询

Google Cloud的 Agent for SAP 通过在 SAP HANA 实例上运行 SQL 查询来收集 SAP HANA 监控指标。除了这些默认查询之外,您还可以通过完成以下步骤来定义和运行自定义 SQL 查询:

  1. 与 Compute Engine 实例或裸金属解决方案服务器建立 SSH 连接。

  2. 打开代理的配置文件:

    /etc/google-cloud-sap-agent/configuration.json
  3. hana_monitoring_configuration.queries 部分下,定义自定义查询。

    如需了解如何定义自定义查询并查看示例,请参阅定义自定义查询

  4. 如需启用自定义查询,请将其 enabled 参数设置为 true

  5. 保存配置文件。

  6. 重启代理以使新设置生效:

    sudo systemctl restart google-cloud-sap-agent

停用 SQL 查询

如果您不想运行Google Cloud的 Agent for SAP 默认提供的任何内置 SQL 查询或您定义的任何自定义查询,则可以通过完成以下步骤停用 SQL 查询:

  1. 与 Compute Engine 实例或裸金属解决方案服务器建立 SSH 连接。

  2. 打开代理的配置文件:

    /etc/google-cloud-sap-agent/configuration.json
  3. 如需停用内置查询或默认查询,请在 hana_monitoring_configuration.queries 部分下添加以下内容:

    {
    "name": "default_QUERY_NAME",
    "enabled": false
    }

    QUERY_NAME 替换为默认查询的名称。如需了解默认查询,请参阅默认查询参考文档

  4. 如需停用自定义查询,请将该自定义查询的 enabled 参数设置为 false

  5. 保存配置文件。

  6. 重启代理以使新设置生效:

    sudo systemctl restart google-cloud-sap-agent

配置参数

下表说明了Google Cloud的 Agent for SAP 的特定于 SAP HANA 监控指标集合的配置参数。

参数
provide_sap_host_agent_metrics

Boolean

如需启用 SAP Host Agent 所需的指标收集功能,请指定 true。 默认值为 true
除非有 Cloud Customer Care 或 SAP 支持团队的指导,否则请勿将 provide_sap_host_agent_metrics 设置为 false

bare_metal

Boolean

在裸金属解决方案服务器上安装代理后时,请指定 true。默认值为 false

log_level

String

如需设置代理的日志记录级别,请设置所需的值。可用的日志级别如下:

  • DEBUG
  • INFO
  • WARNING
  • ERROR

默认为 INFO。除非有 Cloud Customer Care 的指导,否则请勿更改日志记录级别。

log_to_cloud

Boolean

如需将代理的日志重定向到 Cloud Logging,请指定 true。默认值为 true

cloud_properties.project_id

String

如果您的 SAP 系统在裸金属解决方案服务器上运行,请指定您用于裸金属解决方案的 Google Cloud 项目的 ID。

当代理在 Compute Engine 实例上运行时,默认情况下,代理会自动检测项目 ID。

cloud_properties.instance_name

String

如果您的 SAP 系统在 Compute Engine 实例上运行,请指定该计算实例的名称。代理会在安装时自动检测计算实例名称。

如果您的 SAP 系统在裸金属解决方案服务器上运行,请指定该服务器的名称。

cloud_properties.region

String

如果您的 SAP 系统在裸金属解决方案服务器上运行,请指定裸金属解决方案服务器的区域

当代理在计算实例上运行时,默认情况下,代理会使用计算实例部署所在的区域。

cloud_properties.zone

String

当代理在计算实例上运行时,默认情况下,代理会使用部署计算实例的可用区。

cloud_properties.image

String

指定实例的操作系统映像名称。

当代理在计算实例上运行时,默认情况下,代理会自动检测计算实例使用的操作系统映像。

cloud_properties.numeric_project_id

String

指定运行 SAP 系统的 Google Cloud 项目的数字 ID。

当代理在计算实例上运行时,默认情况下,代理会自动检测项目编号。

discovery_configuration.enable_workload_discovery

Boolean

如需让代理收集主机上运行的 SAP 产品的名称和版本,请指定 true。默认值为 true

如需了解详情,请在 google-cloud-sap-agent GitHub 代码库中的 GoogleCloudPlatform/sapagent 下查看该代理的代码库。

discovery_configuration.enable_discovery

Boolean

如需将代理收集的有关主机上运行的 SAP 产品的信息发送到 Cloud Logging,请指定 true。默认值为 true

如果您指定值 false,则代理会将收集的信息存储在主机上,并且不会将其发送到 Cloud Logging。

hana_monitoring_configuration.enabled

Boolean

可选。如需使 Google Cloud的 Agent for SAP 能够收集 SAP HANA 监控指标,请指定 true。默认值为 false

仅当您指定 hana_monitoring_configuration.enabled: true 时,以下子参数才适用。
hana_monitoring_configuration.sample_interval_sec

Int

可选。指定采样时间间隔(以秒为单位),用于确定 Google Cloud的 Agent for SAP 查询 SAP HANA 实例以收集 SAP HANA 监控指标的频率。默认值为 300 秒。

对于在 Google Cloud的 Agent for SAP 的配置文件中定义的每个查询,您可以通过为参数 sample_interval_sec 指定所需的时间间隔来覆盖全局采样时间间隔。采样时间间隔必须至少为 5 秒。

hana_monitoring_configuration.query_timeout_sec

Int

可选。指定对 SAP HANA 实例执行的每个查询的超时时间。 默认值为 300 秒。

hana_monitoring_configuration.execution_threads

Int

可选。指定用于将查询发送到 SAP HANA 实例的线程数。每个查询都在其自己的线程上运行。默认值为 10。

hana_monitoring_configuration.hana_instances.name

String

指定 SAP HANA 实例的名称标识符。

hana_monitoring_configuration.hana_instances.sid

String

指定 SAP HANA 实例的 SID。此字符串会作为标签添加到查询 SAP HANA 实例时生成的所有指标。

hana_monitoring_configuration.hana_instances.host

String

指定托管 SAP HANA 实例的机器(本地或远程)的标识符。支持的值如下:

  • 如果主机是本地机器,则指定字符串 localhost 或 localhost 环回 IP 地址,例如 127.0.0.1
  • 如果主机是远程机器,则指定其内部或外部 IP 地址。
hana_monitoring_configuration.hana_instances.port

String

指定 SAP HANA 实例接收查询的端口。对于第一个或唯一租户数据库实例,该端口为 3NN15,其中 NN 是 SAP HANA 实例的编号。

hana_monitoring_configuration.hana_instances.user

String

指定用于查询 SAP HANA 实例的用户账号。

确保此用户具有读取 SAP HANA 数据库中的监控视图的特权。如果未授予此特权,则与监控视图相关的 SAP HANA 监控指标将不包含任何数据。

hana_monitoring_configuration.hana_instances.password

String

可选。以纯文本形式指定密码,用于对查询 SAP HANA 实例的用户账号进行身份验证。

对于身份验证,您必须指定以下其中一项:

  • 为参数 password 指定明文密码。
  • (推荐)如果您使用 Secret Manager 将密码存储为密文,则必须为参数 secret_name 指定相应的密文名称。
  • (推荐)参数 hdbuserstore_keyhdbuserstore 密钥

对于 SAP HANA 身份验证,代理使用以下优先顺序:如果指定,hdbuserstore_key 配置参数优先于 password 参数,而 password 参数优先于 secret_name 参数。我们建议您在配置文件中仅设置一个身份验证选项。

hana_monitoring_configuration.hana_instances.secret_name

String

可选。指定存储用户账号密码的 Secret Manager 中的密文的名称。

对于 SAP HANA 身份验证,代理使用以下优先顺序:如果指定,hdbuserstore_key 配置参数优先于 password 参数,而 password 参数优先于 secret_name 参数。我们建议您在配置文件中仅设置一个身份验证选项。

hana_monitoring_configuration.hana_instances.hdbuserstore_key

String

如需安全地连接到 SAP HANA 系统,请指定您为该系统创建的安全用户存储区 (hdbuserstore) 密钥。

如需使用 hdbuserstore 密钥进行身份验证,请确保满足以下条件:

  • SAP 工具 hdbsqlhdbuserstore 安装在托管代理的计算实例上。
  • hdbuserstore 密钥对应于一个特定的 SAP HANA 实例。您无法使用包含多个 SAP HANA 实例主机名的密钥。
  • SIDadm 用户可以使用此密钥查询 SAP HANA 数据库。其中,SID 是指您为 sid 参数指定的值。您可以通过以 SIDadm 用户身份运行以下命令来验证这一点:
    hdbsql -U HDB_USERSTORE_KEY "SELECT * FROM DUMMY"

此配置参数从代理版本 3.3 开始受支持。

如果您指定 hdbuserstore_key,则可以跳过指定 hostport 参数。

hana_monitoring_configuration.hana_instances.enable_ssl

Boolean

可选。指定是否在 SAP HANA 实例中启用 SSL。默认值为 false

hana_monitoring_configuration.hana_instances.host_name_in_certificate

String

如果您为 SAP HANA 实例指定 enable_ssl: true,则必须指定在 SSL 证书中设置的主机名。

hana_monitoring_configuration.hana_instances.tls_root_ca_file

String

如果您为 SAP HANA 实例指定 enable_ssl: true,则必须指定安全证书的路径。

hana_monitoring_configuration.queries.enabled

Boolean

可选。如需为所有 SAP HANA 实例启用 SQL 查询,请为该 SQL 查询的参数 enabled 指定值 true

hana_monitoring_configuration.queries.name

String

如果您已在配置文件中定义了自定义查询,则必须为每个自定义查询指定唯一的名称。

查询名称必须是唯一的,因为它用于在 Monitoring 中构建指标的默认网址。

hana_monitoring_configuration.queries.sql

String

指定代理向 SAP HANA 实例发出的 SQL 语句。

SQL 语句必须符合 SAP 在 SAP HANA SQL 和系统视图参考文档中定义的 SQL 语法。
hana_monitoring_configuration.queries.sample_interval_sec

Int

可选。指定 SQL 查询的采样时间间隔。这会替换全局采样时间间隔。该值必须至少为 5 秒。

hana_monitoring_configuration.queries.columns.name

String

指定唯一标识每一列的名称。

列名称必须是唯一的,因为它用于在 Monitoring 中构建指标的默认网址。

hana_monitoring_configuration.queries.columns.metric_type

String

为了让 Monitoring 进行处理,请指定以下指标类型之一:METRIC_LABELMETRIC_GAUGEMETRIC_CUMULATIVE

METRIC_LABEL 类型的指标会作为标签附加到向 Monitoring 发送的所有 METRIC_GAUGEMETRIC_CUMULATIVE 指标。

hana_monitoring_configuration.queries.columns.value_type

String

为了让 Monitoring 进行处理,请指定指标类型支持的数据类型。

支持的数据类型如下:VALUE_BOOLVALUE_INT64VALUE_STRINGVALUE_DOUBLE。如需了解详情,请参阅支持的组合

hana_monitoring_configuration.queries.columns.name_override

String

可选。为了让 Monitoring 进行处理,请指定要在指标网址中显示的路径,而不是查询名称和列名称。例如:

  • 指标的默认网址: workload.googleapis.com/sap/hanamonitoring/QUERY_NAME/COLUMN_NAME
  • 使用自定义路径的指标网址: workload.googleapis.com/sap/hanamonitoring/CUSTOM_PATH

查看收集的指标

如需直观呈现代理收集的 SAP HANA 监控指标,您可以使用Google Cloud 提供的以下自定义信息中心:

  • SAP 代理 - 详细的 HANA 概览:此信息中心提供显示以下指标的状态概览的图表:实例内存、服务内存用量、架构估算的最大内存、行存储内存总大小、架构读取离群值、架构写入离群值、架构上次压缩的记录计数离群值、系统连接、提醒、前 5 个计算实例的 CPU 百分比、前 5 个计算实例的内存百分比,以及按区域划分的主机。

    此信息中心的 JSON 文件为 agent-for-sap-hana-detailed-overview.json

  • Agent for SAP - HANA 性能:此信息中心提供显示以下指标原始指标值的图表:实例内存、架构读取和写入离群值、架构性能、内存用量、架构记录数离群值、已使用的服务总内存、行存储的内存大小、系统空闲和正在运行的连接、连接和行存储的内存、架构总记录数,以及架构估算的总大小上限。

    此信息中心的 JSON 文件为 agent-for-sap-hana-performance.json

安装信息中心

如需安装自定义信息中心,请完成以下步骤:

Google Cloud 控制台

  1. 在 Google Cloud 控制台中,前往 Monitoring 页面:

    进入 Monitoring

  2. 在 Monitoring 导航面板中,点击信息中心

  3. 点击示例库标签页。

    显示选定的示例库标签页。

  4. 如需过滤特定于代理的自定义信息中心,请在过滤条件字段中输入 Agent for SAP

  5. (可选)如需查看有关信息中心的详细信息或预览其内容,请点击预览

  6. 选择要安装的信息中心。

  7. 点击导入,然后点击确认

    信息中心会添加到 Google Cloud 项目中的可用信息中心。如需查看您的信息中心,请按照查看已安装的信息中心中的说明进行操作。

Google Cloud CLI

  1. 打开 Cloud Shell:

    打开 Cloud Shell

  2. 在 Cloud Shell 中,克隆或下载代码库:

    git clone https://github.com/GoogleCloudPlatform/monitoring-dashboard-samples/

  3. 在 Cloud Shell 中,使用相应的 JSON 文件安装所需的信息中心:

    gcloud monitoring dashboards create --config-from-file=CONFIG_FROM_FILE

    CONFIG_FROM_FILE 替换为包含信息中心配置的 JSON 文件的路径。信息中心配置文件可位于以下路径中:monitoring-dashboard-samples/dashboards/google-cloud-agent-for-sap

    信息中心会添加到 Google Cloud 项目中的可用信息中心。如需查看您的信息中心,请按照查看已安装的信息中心中的说明进行操作。

查看已安装的信息中心

如需查看已安装的信息中心,请按照以下步骤操作:

  1. 在 Google Cloud 控制台中,前往 Monitoring 页面:

    进入 Monitoring

  2. 在 Monitoring 导航面板中,点击信息中心

  3. 在列表中点击信息中心名称。

如果您有许多信息中心,则可以针对自定义信息中心或新信息中心的名称进行过滤。如需了解如何过滤此列表,请参阅查看自定义信息中心

下图是一个示例,展示了 Monitoring 中 SAP HANA 指标的自定义信息中心的一部分。

屏幕截图展示了 Monitoring 中 SAP HANA 指标的自定义信息中心