This guide shows you how to configure Google Cloud's Agent for SAP to collect the Workload Manager evaluation metrics from your SAP systems.
For information about this feature, see Workload Manager evaluation using Google Cloud's Agent for SAP.
Before you begin
- Validate your installation of Google Cloud's Agent for SAP. For instructions, see the installation guide for your scenario.
- If you have installed the agent on a Bare Metal Solution server, then make sure that you have completed the required prerequisites and set up a service account. For instructions, see Configure Google Cloud's Agent for SAP on Linux.
Make sure that the Workload Manager API is enabled for your Google Cloud project.
Set IAM roles
To allow Google Cloud's Agent for SAP to collect Workload Manager evaluation metrics, you must ensure that the service account being used by your Compute Engine VM instance or Bare Metal Solution server includes the following roles:
- Compute Viewer (
roles/compute.viewer
) - Workload Manager Insights Writer (
roles/workloadmanager.insightWriter
) - Secret Manager Secret Accessor (
roles/secretmanager.secretAccessor
), if you use Secret Manager for storing SAP HANA database password.
To add these required roles to your service account, follow these steps:
In the Google Cloud console, go to the IAM page.
Select your Google Cloud project.
Identify the service account to which you want to add a role.
- If the service account isn't already on the principals list, then it doesn't have any roles assigned to it. Click Add and enter the email address of the service account.
- If the service account is already on the principals list, then it has existing roles. Click the Edit button for the service account that you want to edit.
Select the required role from the list of available roles:
- Compute Viewer
- Workload Manager > Workload Manager Insights Writer
- Secret Manager > Secret Manager Secret Accessor
Click Add or Save to apply the roles to the service account.
Verify the agent version
Google Cloud recommends that you install the latest version of Agent for SAP for accurate evaluation of your SAP workloads because periodic releases of the Agent for SAP might add or change metrics that are used for the evaluation.
To ensure that you have the latest version of Google Cloud's Agent for SAP, you need to check for updates periodically and update the agent.
Install an update
Select your operating system, and then follow the steps:
RHEL
- Establish an SSH connection with your instance.
- Update your agent instance:
- (Recommended) To update to version 3.6 (latest)
of the agent:
sudo yum --nogpgcheck update google-cloud-sap-agent
- To update to a specific version of the agent:
sudo yum install google-cloud-sap-agent-VERSION_NUMBER.x86_64
Replace
VERSION_NUMBER
with the agent's version number that you want to install, such as3.1-606637668
. For information about the agent versions that you can install, see List all available versions of the agent.
- (Recommended) To update to version 3.6 (latest)
of the agent:
SLES
- Establish an SSH connection with your instance.
- Update your agent instance:
- (Recommended) To update to version 3.6 (latest)
of the agent:
sudo zypper --no-gpg-checks update google-cloud-sap-agent
- To update to a specific version of the agent:
sudo zypper install google-cloud-sap-agent-VERSION_NUMBER.x86_64
Replace
VERSION_NUMBER
with the agent's version number that you want to install, such as3.1-606637668
. For information about the agent versions that you can install, see List all available versions of the agent.
- (Recommended) To update to version 3.6 (latest)
of the agent:
Enable Workload Manager evaluation metrics collection
From version 3.2, new installations of Google Cloud's Agent for SAP are enabled by default to collect the Workload Manager evaluation metrics. If you're updating to version 3.2 from a previous version, you can also explicitly enable the feature. To do so, complete the following steps:
Establish an SSH connection with your Compute Engine VM instance or Bare Metal Solution server.
To let the agent collect the Workload Manager evaluation metrics:
sudo /usr/bin/google_cloud_sap_agent configure -feature=workload_evaluation -enable
To enable the collection of the "SAP HANA Insights" and "SAP HANA Security Best Practices" metrics:
Open the agent's configuration file:
/etc/google-cloud-sap-agent/configuration.json
Alternatively, you can also perform this configuration by running commands. For more information, see Configuration commands for Google Cloud's Agent for SAP.
Add the
workload_validation_db_metrics_config
section aftercollect_workload_validation_metrics
, and then specify the following parameters:hana_db_user
: specify the SAP HANA database user account that is used to query the SAP HANA instance.hostname
: specify the identifier for the machine, either local or remote, that hosts your SAP HANA instance.port
: specify the port on which your SAP HANA instance accepts queries.sid
: specify the SID of your SAP HANA instancehana_db_password_secret_name
: specify the name of the secret in Secret Manager that stores the user account's passwordAs an alternative to the secret, you can use the
hdbuserstore_key
configuration parameter.hdbuserstore_key
: specify thehdbuserstore
key that authenticates the user you specified forhana_db_user
If you specify
hdbuserstore_key
, then you skip specifying thehostname
andport
parameters.
For information about these parameters, see Configuration parameters.
Optionally, under the
cloud_properties
section, you can update the parameter values that are set automatically. To do so, add thecloud_properties
section to your configuration file, and then specify the required parameters and their values.Save the configuration file.
Restart the agent for the new settings to take effect:
sudo systemctl restart google-cloud-sap-agent
Example configuration files
Compute Engine VM instance
The following examples are completed configuration files of Google Cloud's Agent for SAP running on a Compute Engine VM instance, where the collection of Workload Manager evaluation metrics is enabled.
For SAP HANA authentication, the agent uses the following order of
preference: if specified, the hdbuserstore_key
configuration
parameter is preferred over the hana_db_password
parameter, which
is preferred over the hana_db_password_secret_name
parameter. We
recommend that you set only one authentication option in your configuration
file.
- The following example uses a
Secure user store (
hdbuserstore
) key for SAP HANA authentication:{ "provide_sap_host_agent_metrics": true, "bare_metal": false, "log_level": "INFO", "log_to_cloud": true, "collection_configuration": { "collect_workload_validation_metrics": true, "workload_validation_db_metrics_frequency": 3600, "workload_validation_db_metrics_config": { "hana_db_user": "system", "sid": "DEH", "hdbuserstore_key": "user_store_key" }, "collect_process_metrics": false }, "discovery_configuration": { "enable_discovery": true, "enable_workload_discovery": true }, "hana_monitoring_configuration": { "enabled": false } }
- The following example uses a username and Secret Manager
secret for SAP HANA authentication:
{ "provide_sap_host_agent_metrics": true, "bare_metal": false, "log_level": "INFO", "log_to_cloud": true, "collection_configuration": { "collect_workload_validation_metrics": true, "workload_validation_db_metrics_frequency": 3600, "workload_validation_db_metrics_config": { "hana_db_user": "system", "sid": "DEH", "hana_db_password_secret_name": "instance-id-hana-db-password-secret", "hostname": "localhost", "port": "30015" }, "collect_process_metrics": false }, "discovery_configuration": { "enable_discovery": true, "enable_workload_discovery": true }, "hana_monitoring_configuration": { "enabled": false } }
- The following example uses a username and password for SAP HANA
authentication. We recommend that you instead use a
Secret Manager secret or
Secure user store (
hdbuserstore
) key for SAP HANA authentication.{ "provide_sap_host_agent_metrics": true, "bare_metal": false, "log_level": "INFO", "log_to_cloud": true, "collection_configuration": { "collect_workload_validation_metrics": true, "workload_validation_db_metrics_frequency": 3600, "workload_validation_db_metrics_config": { "hana_db_user": "system", "sid": "DEH", "hana_db_password": "TempPa55word", "hostname": "localhost", "port": "30015" }, "collect_process_metrics": false }, "discovery_configuration": { "enable_discovery": true, "enable_workload_discovery": true }, "hana_monitoring_configuration": { "enabled": false } }
Bare Metal Solution server
The following examples are completed configuration files of Google Cloud's Agent for SAP running on a Bare Metal Solution server, where the collection of Workload Manager evaluation metrics is enabled.
For SAP HANA authentication, the agent uses the following order of
preference: if specified, the hdbuserstore_key
configuration
parameter is preferred over the hana_db_password
parameter, which
is preferred over the hana_db_password_secret_name
parameter. We
recommend that you set only one authentication option in your configuration
file.
- The following example uses a
Secure user store (
hdbuserstore
) key for SAP HANA authentication:{ "provide_sap_host_agent_metrics": true, "bare_metal": true, "log_level": "INFO", "log_to_cloud": true, "collection_configuration": { "collect_workload_validation_metrics": true, "workload_validation_db_metrics_frequency": 3600, "workload_validation_db_metrics_config": { "hana_db_user": "system", "sid": "DEH", "hdbuserstore_key": "user_store_key" }, "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": false } } - The following example uses a username and Secret Manager
secret for SAP HANA authentication:
{ "provide_sap_host_agent_metrics": true, "bare_metal": true, "log_level": "INFO", "log_to_cloud": true, "collection_configuration": { "collect_workload_validation_metrics": true, "workload_validation_db_metrics_frequency": 3600, "workload_validation_db_metrics_config": { "hana_db_user": "system", "sid": "DEH", "hana_db_password_secret_name": "instance-id-hana-db-password-secret", "hostname": "localhost", "port": "30015" }, "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": false } } - The following example uses a username and password for SAP HANA
authentication. We recommend that you instead use a
Secret Manager secret or
Secure user store (
hdbuserstore
) key for SAP HANA authentication.{ "provide_sap_host_agent_metrics": true, "bare_metal": true, "log_level": "INFO", "log_to_cloud": true, "collection_configuration": { "collect_workload_validation_metrics": true, "workload_validation_db_metrics_frequency": 3600, "workload_validation_db_metrics_config": { "hana_db_user": "system", "sid": "DEH", "hana_db_password": "TempPa55word", "hostname": "localhost", "port": "30015" }, "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": false } }
Configuration parameters
The following table explains the configuration parameters of Google Cloud's Agent for SAP that are specific to the collection of the Workload Manager evaluation metrics.
Parameters | |
---|---|
provide_sap_host_agent_metrics |
To enable the collection of the metrics required by the
SAP Host Agent, specify |
bare_metal |
When the agent is installed on a Bare Metal Solution server, specify
|
log_level |
To set the logging level of the agent, set the required value. The available log levels are as follows:
Default is |
log_to_cloud |
To redirect the agent's logs to
Cloud Logging, specify
|
cloud_properties.project_id |
If your SAP system is running on a Bare Metal Solution server, then
specify the project ID of the Google Cloud project that you are
using with Bare Metal Solution. |
cloud_properties.instance_name
|
If your SAP system is running on a Compute Engine VM instance, then specify the name that VM instance. The agent automatically detects the VM instance name upon installation. If your SAP system is running on a Bare Metal Solution server, then specify the name of that server. |
cloud_properties.region |
If your SAP system is running on a Bare Metal Solution server,
then specify the region of the Bare Metal Solution server. |
cloud_properties.zone |
When the agent runs on a VM instance, by default, the agent uses the zone of the VM instance that the agent is installed on. |
cloud_properties.image |
Specify the OS image name of the instance. |
cloud_properties.numeric_project_id |
Specify the numeric ID of the Google Cloud project that the SAP system
is running in. |
discovery_configuration.enable_workload_discovery |
To let the agent collect the names and versions of the SAP products
running on the host, specify For more information, see the agent's codebase in the
|
discovery_configuration.enable_discovery |
To send to Cloud Logging the information that the agent collects about
the SAP products running on the host, specify If you specify the value |
collection_configuration.collect_workload_validation_metrics |
To enable Workload Manager evaluation metrics collection,
specify |
collection_configuration.workload_validation_metrics_frequency |
The collection frequency of the Workload Manager
evaluation metrics in seconds. The default value is If you need to modify the collection frequency of the
Workload Manager metrics, then add the
|
collection_configuration.workload_validation_collection_definition.fetch_latest_config |
Optional. The default value is |
collection_configuration.workload_validation_db_metrics_config.hana_db_user |
Specify the user account that is used to query the SAP HANA instance. The user account must have the read permission to the SAP HANA database. |
collection_configuration.workload_validation_db_metrics_config.hana_db_password |
Specify the password for the user account that is used to query the SAP HANA instance. For SAP HANA authentication, the agent uses the following order of
preference: if specified, the |
collection_configuration.workload_validation_db_metrics_config.hana_db_password_secret_name |
Specify the name of the secret in Secret Manager that stores the user account's password. Alternatively, you can specify the For SAP HANA authentication, the agent uses the following order of
preference: if specified, the |
collection_configuration.workload_validation_db_metrics_config.hdbuserstore_key
|
To securely connect to an SAP HANA system, specify a
Secure user store ( To use an
This configuration parameter is supported from version 3.3 of the agent. If you specify For SAP HANA authentication, the agent uses the following order of
preference: if specified, the |
collection_configuration.workload_validation_db_metrics_config.sid |
Specify the SID of your SAP HANA instance. |
collection_configuration.workload_validation_db_metrics_config.hostname |
Specify the identifier for the machine, either local or remote, that hosts your SAP HANA instance. The following are the supported values:
|
collection_configuration.workload_validation_db_metrics_config.port |
Specify the port on which your SAP HANA instance accepts queries. For
the first or only tenant database instance, the port is
|
collection_configuration.workload_validation_db_metrics_frequency |
The collection frequency of the SAP HANA database metrics, in seconds,
for Workload Manager evaluation.
Default is |
View the collected metrics
To view the Workload Manager evaluation metrics that the agent collects, you can do the following:
See the agent's log file:
Set the agent's log level to
DEBUG
:sudo /usr/bin/google_cloud_sap_agent configure -loglevel=debug
After the agent restarts to effect the new log level, see the agent's log file:
/var/log/google-cloud-sap-agent.log
In the log file, look for entries that contain the following:
workload.googleapis.com/sap/validation/
The following is an example that shows Workload Manager evaluation metrics in the agent's log file:
{"level":"debug","timestamp":"2024-05-31T20:13:39.439Z",..."context":"WorkloadManagerMetrics",
"metric":"workload.googleapis.com/sap/validation/system","value":1} {"level":"debug","timestamp":"2024-05-31T20:13:39.439Z",..."context":"WorkloadManagerMetrics",
"key":"instance_name","value":"n1-hana-sles15"} {"level":"debug","timestamp":"2024-05-31T20:13:39.439Z",..."context":"WorkloadManagerMetrics",
"key":"os","value":"sles-15-SP4"} ... {"level":"debug","timestamp":"2024-05-31T20:13:39.439Z",..."context":"WorkloadManagerMetrics",
"metric":"workload.googleapis.com/sap/validation/corosync","value":0} ...
If your agent instance is configured to send logs to Cloud Logging, then you can view the agent's logs in Cloud Logging.
Create and run an evaluation for your SAP workload in Workload Manager. For more information, see Create and run an evaluation.
For information about the best practices that Workload Manager supports for evaluating SAP workloads running on Google Cloud, see Workload Manager best practices for SAP.