Customizing the Liberty data collector

You can set the variables to change the default behavior of the Liberty data collector.

User-defined environment variables for the Liberty data collector

For Liberty monitoring in IBM Cloud Private or OpenShift, set the following variables in the application yaml file.

For on-premises applications, set the following variables as environment variables or in the config.properties file.

Table 1. Supported user-defined environment variables for Liberty monitoring
Variable name Value Description
APPLICATION_NAME Any value that you want for the application name. The APPLICATION_NAME is used for the resource name in the UI. If APPLICATION_NAME is specified, it is displayed in the resource name. Otherwise, deployment name(Kubernetes environment) or host name(on-premise environment) is displayed in the resource name.
Example:
- name: APPLICATION_NAME
value: libertytt3otr-icam
LOG_REST_PAYLOAD true By default, it is false. When you enable this variable by setting it as true, the payload details are recorded in the log.
Example:
- name: LOG_REST_PAYLOAD
value: "true"
IBM_APM_RESTCLIENT_LOGLEVEL This variable works together with LOG_REST_PAYLOAD. Specify this variable when you set the LOG_REST_PAYLOAD as true.
- DEBUG_MAX
- ERROR
- INFO
- WARN
- DEBUG_MAX: Only useful debug information is printed in the log, for example, collected data, data that are sent to server, and server response.
- ERROR: Only information about exceptions and unexpected situations is printed in the log.
- INFO: The summary information about the data collector for the user to know what it is doing is printed in the log.
- WARN: Warning information is printed in the log.
If you do not specify this variable, it is INFO by default.
OPENTRACING_ENABLED false By default, the Liberty data collector enables OpenTracing function. You can disable OpenTracing by setting the environment variable to false.
Example:
- name: OPENTRACING_ENABLED
value: "false"
OpenTracing sampling:
- JAEGER_SAMPLER_TYPE
JAEGER_SAMPLER_PARAM
The default sampler type is probabilistic, and the default sampler param is 0.01, which means that 1 in 100 traces will be sampled. You can set it to other values. For more information, see Sampling. When the OpenTracing function is enabled, you can set the OpenTracing sampler type and param. The sampling type and param variables must be set in pairs. If you set only JAEGER_SAMPLER_TYPE, or only JAEGER_SAMPLER_PARAM, you will have a problem showing the tracing data.
Example:
- name: JAEGER_SAMPLER_TYPE
value: "probabilistic"
- name: JAEGER_SAMPLER_PARAM
value: "0.1"
LATENCY_SAMPLER_PARAM Any value between 0 and 1 The default value is 0.1, which means getting 1 request out of 10 requests. The value must be between 0 and 1. The value of 0 means no latency data will be collected. The value of 1 means no sampler and all requests data will be collected.
Example:
- name: LATENCY_SAMPLER_PARAM
value: "0.2"
UA_LWDC_LISTENER_URL For on-premises: UA_LWDC_LISTENER_URL=http://<ip or host>:<port>
For Kubernetes: UA_LWDC_LISTENER_URL=http://lwdc.<NAMESPACE>:8848
You always need to set this variable in on-premises installation. <ip or host> is the ip or host address where you install Unified Agent in on-premises environment. <port> is the port that you configure in Installing and configuring Unified Agent plug-ins. By default, it is 8848 for UA_LWDC_LISTENER_URL.
But for Kubernetes, you need to set this variable only when your Unified Agent is not installed in default namespace of cp4mcm-cloud-native-monitoring, replace <NAMESPACE> with the namespace where you install Unified Agent.
UA_JAEGER_ENDPOINT For on-premises: UA_JAEGER_ENDPOINT=http://<ip or host>:<port>/api/traces
For Kubernetes: UA_JAEGER_ENDPOINT=http://jaeger.<NAMESPACE>:14268/api/traces
You always need to set this variable in on-premises installation. <ip or host> is the ip or host address where you install Unified Agent in on-premises environment. <port> is the port that you configure in Installing and configuring Unified Agent plug-ins. By default, it is 14268 for UA_JAEGER_ENDPOINT.
But for Kubernetes, you need to set this variable only when your Unified Agent is not installed in default namespace of cp4mcm-cloud-native-monitoring, replace <NAMESPACE> with the namespace where you install Unified Agent.