Enabling and customizing the Metrics Monitoring framework in a development environment

In order to use and extend the HCL Commerce Version 9.1 Metrics Monitoring framework in your HCL Commerce development environment, enable it in each of the Transaction, Search, Customization (Xc) and Store servers.

Enabling metrics on the Transaction server

  1. Configure WebSphere Application Server.
    1. Define a new port (Application servers > server1 > Web container transport chains). Provide the following values in the corresponding fields:
      • Transport chain name: monitor
      • template: (not secure)
      • create new port:
      • name: monitor
      • host: *
      • port: 5280 (ensure that this port is not already used)
    2. Add the port to WC_default_host.
      host Name: *
       port: 5280
    3. Set up generic JVM arguments in WebSphere Application Server.
      dd -Dexpose_metrics=true (
      For more information, see Setting generic JVM arguments in WebSphere Application Server.
  2. Restart the Transaction server.

Enabling metrics on the Search server

  1. Add the following in jvm.options:
    -Dexpose_metrics=true
  2. dd the following in server.xml:
    <httpEndpoint host="*" httpPort="3280" httpsPort="3243" id="defaultMonitorEndpoint"/>
  3. Restart the Search server.

Enabling metrics on the Store server

  1. Add the following in jvm.options:
    -Dexpose_metrics=true 
  2. Add the following in server.xml:
    <httpEndpoint host="*" httpPort="8280" httpsPort="8243" id="defaultMonitorEndpoint"/>
  3. Restart the Store server.

Enabling metrics on the Customization server

  1. Add the following in jvm.options:
    -Dexpose_metrics=true
  2. Add the following in server.xml:
    <httpEndpoint host="*" httpPort="9280" httpsPort="9243" id="defaultMonitorEndpoint"/>
  3. Restart the Customization server.

Enabling Cache Provider configuration on toolkit

Perform the following actions on the WebSphere Application Server server.
  1. Create a new Docker container named redis.
    docker run --name redis -e ALLOW_EMPTY_PASSWORD=yes bitnami/redis:latest
  2. Open the toolkit/setup/hcl-cache/cache_cfg.yaml file, and ensure that the redis container yamlConfig entry has the correct location for redis_cfg.yaml.
  3. Set the following environment variable.
    CACHE_MANAGER_CONFIG=cache 
    Where cache is the location of the cache_cfg.yaml file. For example, W:\WCDE_V9\setup\hcl-cache\cache_cfg.yaml.

    For more information, see Setting generic JVM arguments in WebSphere Application Server.

  4. Define the HCL Cache provider. Run the following command:
    WCDE_installdir\wasprofile\bin\wsadmin.bat -conntype NONE -f toolkit\setup\setCacheProvider.py\defineHCLCacheProvider.py
    For example:
    W:\WCDE_V9\wasprofile\bin\wsadmin.bat -conntype NONE -f toolkit\setup\setCacheProvider.py\defineHCLCacheProvider.py
  5. Configure all caches with the new cache provider.
    <toolkit>\wasprofile\bin\wsadmin.bat -conntype NONE -f toolkit\setup\setCacheProvider.py\setCacheProvider.py provider_name all | filename 
    For example:
    W:\WCDE_V9\wasprofile\bin\wsadmin.bat -conntype NONE -f toolkit\setup\setCacheProvider.py\setCacheProvider.py hcl-cache all
Perform the following actions on the WebSphere Application Server V8.5.5 Liberty server.
  1. 1. Set the environment variable in the server.env file.
    CACHE_MANAGER_CONFIG=cache
    Where cache is the location of the cache_cfg.yaml file. For example,
    W:\WCDE_V9\setup\hcl-cache\cache_cfg.yaml
  2. Update the server.xml file.
    <distributedMap id="services/cache/SearchDistributedMapCache" memorySizeInEntries="2001" highThreshold="98" lowThreshold="95" cacheProviderName="hcl-cache"/>

Customizing metrics

In order to extend the Metrics Monitoring framework, you must:
  1. Obtain and include the micrometer-core-*.jar Java Archive file in the classpath for your extension project.
    1. Navigate to and open the WCDE_installdir\plugins\micrometer-bundle.jar.
    2. Extract the micrometer-core-*.jar Java Archive file to an accessible folder.
    3. Add this folder to the classpath for the extensionLogic project.
  2. Add the micrometer-core-*.jar Java Archive file to the WCBD classpath for building and packaging your customization.
    1. Open the WCB_installdir/wcbd-build.properties WCBD configuration file for editing.

      For more information on this file, see Packaging configuration properties.

    2. Add the micrometer-core-*.jar Java Archive file to the ext.compile.class.path= class path definition line.
      Note: The class path that contains more files that are required for compilation. Folders can contain loose Java classes (.class files). Java archives (.JAR files) must be listed individually. Files and folders must be delineated by a colon.
    3. Save and close the file.
You can now extend, package, and deploy customizations to the Metrics Monitoring framework.