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
- Configure WebSphere Application Server.
- Define a new port (
- Transport chain name: monitor
- template: (not secure)
- create new port:
- name: monitor
- host: *
- port: 5280 (ensure that this port is not already used)
). Provide the following values in the corresponding fields: - Add the port to
WC_default_host
.host Name: * port: 5280
- Set up generic JVM arguments in WebSphere Application Server.
For more information, see Setting generic JVM arguments in WebSphere Application Server.dd -Dexpose_metrics=true (
- Define a new port (
- Restart the Transaction server.
Enabling metrics on the Search server
- Add the following in
jvm.options:
-Dexpose_metrics=true
- dd the following in
server.xml:
<httpEndpoint host="*" httpPort="3280" httpsPort="3243" id="defaultMonitorEndpoint"/>
- Restart the Search server.
Enabling metrics on the Store server
- Add the following in jvm.options:
-Dexpose_metrics=true
- Add the following in
server.xml:
<httpEndpoint host="*" httpPort="8280" httpsPort="8243" id="defaultMonitorEndpoint"/>
- Restart the Store server.
Enabling metrics on the Customization server
- Add the following in
jvm.options:
-Dexpose_metrics=true
- Add the following in
server.xml:
<httpEndpoint host="*" httpPort="9280" httpsPort="9243" id="defaultMonitorEndpoint"/>
- Restart the Customization server.
Enabling Cache Provider configuration on toolkit
Perform the following actions on the WebSphere Application Server server.
- Create a new Docker container named
redis
.docker run --name redis -e ALLOW_EMPTY_PASSWORD=yes bitnami/redis:latest
- Open the toolkit/setup/hcl-cache/cache_cfg.yaml file,
and ensure that the
redis
containeryamlConfig
entry has the correct location for redis_cfg.yaml. - Set the following environment
variable.
Where cache is the location of the cache_cfg.yaml file. For example, W:\WCDE_V9\setup\hcl-cache\cache_cfg.yaml.CACHE_MANAGER_CONFIG=cache
For more information, see Setting generic JVM arguments in WebSphere Application Server.
- Define the HCL Cache provider. Run the following
command:
For example:WCDE_installdir\wasprofile\bin\wsadmin.bat -conntype NONE -f toolkit\setup\setCacheProvider.py\defineHCLCacheProvider.py
W:\WCDE_V9\wasprofile\bin\wsadmin.bat -conntype NONE -f toolkit\setup\setCacheProvider.py\defineHCLCacheProvider.py
- Configure all caches with the new cache
provider.
For example:<toolkit>\wasprofile\bin\wsadmin.bat -conntype NONE -f toolkit\setup\setCacheProvider.py\setCacheProvider.py provider_name all | filename
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. Set the environment variable in the server.env
file.
Where cache is the location of the cache_cfg.yaml file. For example,CACHE_MANAGER_CONFIG=cache
W:\WCDE_V9\setup\hcl-cache\cache_cfg.yaml
- 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:
- Obtain and include the
micrometer-core-*.jar Java
Archive file in the classpath for your extension project.
- Navigate to and open the WCDE_installdir\plugins\micrometer-bundle.jar.
- Extract the micrometer-core-*.jar Java Archive file to an accessible folder.
- Add this folder to the classpath for the
extensionLogic
project.
- Add the micrometer-core-*.jar Java
Archive file to the WCBD classpath for building and packaging your
customization.
- Open the
WCB_installdir/wcbd-build.properties
WCBD configuration file for editing.
For more information on this file, see Packaging configuration properties.
- 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. - Save and close the file.
- Open the
WCB_installdir/wcbd-build.properties
WCBD configuration file for editing.