Configure Agent for SAP for metrics collection

Google Cloud's Agent for SAP provides support for monitoring your SAP workloads running on Compute Engine instances and it helps you run SAP systems efficiently on Google Cloud. You must install Google Cloud's Agent for SAP on all VMs that run any SAP system. This agent collects and sends all the required information that SAP mandates to the SAP Host Agent. For more information, see SAP Note 2469354.

To collect the underlying infrastructure and application metrics that are used for observability, you must enable additional features for the Agent for SAP.

This document describes how to enable these features in Agent for SAP.

Checklist for Agent for SAP

The following checklist summarizes the tasks you need to perform to ensure that the Agent for SAP is set up properly for observability:

Install and configure Agent for SAP
Install and configure Google Cloud's Agent for SAP on each Compute Engine VM that you want to monitor.
Agent for SAP is packaged with the following "for SAP" public OS images:
  • RHEL: all "for SAP" images
  • SLES: SLES 15 SP4 for SAP and later versions

For more information, see Install and configure Agent for SAP on a VM.

Update Agent for SAP
Version 3.5 of Agent for SAP contains all features that are required to set up observability for SAP. If the agent was previously installed, we recommend that you update it to the latest version.

For more information, see Update Google Cloud's Agent for SAP.

Enable Agent for SAP's system discovery feature
In the agent's configuration file, the following parameters must be set to true. If you installed the agent after February 14, 2024, these flags are set to true by default and no change is required.
  • discovery_configuration.enable_workload_discovery
  • discovery_configuration.enable_discovery
If you installed the agent before February 14, 2024, or if you've disabled the system's discovery feature, run the following commands:
         sudo /usr/bin/google_cloud_sap_agent configure -feature=sap_discovery -enable 
sudo /usr/bin/google_cloud_sap_agent configure -feature=workload_discovery -enable

For more information, see Configure Google Cloud's Agent for SAP.

Enable Agent for SAP's Process Monitoring metric collection
In the agent's configuration file, the collection_configuration.collect_process_metrics parameter must be set to true. To enable the feature, run the following command:
         sudo /usr/bin/google_cloud_sap_agent configure -feature=process_metrics -enable

For more information, see Configure Process Monitoring metrics collection.

Enable Agent for SAP's HANA Monitoring metric collection
On HANA VMs, you must enable the HANA Process Monitoring metrics collection. To enable this feature, run the following command:
         sudo /usr/bin/google_cloud_sap_agent configure -feature=hana_monitoring -enable

Edit the hana_monitoring_configuration section in the agent's configuration file to provide the HANA instance name, SID, host, port, user, and password (either using Secret or an hdbuserstore key).

Note that the specified HANA user must have read access to the tables being queried by the default queries.

For more information, see Configure SAP HANA Monitoring metrics collection.

Validate the agent configuration and Google Cloud setup
Verify that the agent is configured correctly by running the following command:
         sudo /usr/bin/google_cloud_sap_agent status

For more information, see Validate the setup for Workload Manager observability.

Restart Agent for SAP
Restart the agent for the changes to take effect by running the following command:
         sudo systemctl restart google-cloud-sap-agent

For more information, see Restart the agent.

Validate the setup for Workload Manager observability

You can validate if you have the correct Google Cloud setup for using the Workload Manager observability service by running the agent's status command. This command is supported from version 3.7 of the agent.

To validate the Google Cloud setup, complete the following steps:

  1. Establish an SSH connection with your Compute Engine instance.
  2. Run the following command:

    sudo /usr/bin/google_cloud_sap_agent status
    

    If your Google Cloud setup for using the Workload Manager observability service is correct, then the output includes the following. Your configuration might have values other than the default ones.

    Agent Status:
        Installed version: 3.7-....
        ...
        Systemd Service Enabled: True
        Systemd Service Running: True
        Cloud API Full Scopes: True
        Configuration File: /etc/google-cloud-sap-agent/configuration.json
        Configuration Valid: True
    ...
    ----------------------------------------------------------------------------
    Process Metrics: Enabled
        Status: Fully Functional
        IAM Permissions: All granted
        Configuration:
            collect_process_metrics:        true (configuration file)
            process_metrics_frequency:      5    (default)
            process_metrics_to_skip:        []   (default)
            slow_process_metrics_frequency: 30   (default)
    ...
    ----------------------------------------------------------------------------
    HANA Monitoring Metrics: Enabled
        Status: Fully Functional
        IAM Permissions: All granted
        Configuration:
            connection_timeout:       120   (default)
            enabled:                  true  (configuration file)
            execution_threads:        10    (default)
            max_connect_retries:      1     (default)
            query_timeout_sec:        300   (default)
            sample_interval_sec:      300   (default)
            send_query_response_time: false (default)
    ...
    ----------------------------------------------------------------------------
    System Discovery: Enabled
        Status: Fully Functional
        IAM Permissions: All granted
        Configuration:
            enable_discovery:                  true  (default)
            enable_workload_discovery:         true  (default)
            sap_instances_update_frequency:    60    (default)
            system_discovery_update_frequency: 14400 (default)
    ...
    
  3. If your output conveys that some setup is missing, then review the information provided in the preceding sections, perform the required actions, and then re-run the status command to re-validate the setup.

Example configuration file

Once you've enabled the features for observability, Agent for SAP's configuration file looks similar to the following:

  {
    "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": true
  },
  "discovery_configuration": {
     "enable_workload_discovery": true,
     "enable_discovery": true
  },
  "hana_monitoring_configuration": {
    "enabled": true,
    "hana_instances": [
      {
        "name": "local",
        "sid": "DEH",
        "host": "localhost",
        "port": "30015",
        "user": "system",
        "secret_name": "password-secret-name"
      },
    ],
   }
  }
  

What's next