Customizing the Ruby data collector

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

User-defined environment variables for the Ruby data collector

For Ruby monitoring in Kubernetes environments, 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 Ruby monitoring
Variable name Value Description
OPENTRACING_ENABLED false By default, the OpenTracing function is enabled. You can disable OpenTracing by setting the environment variable to false.
Example:
- name: OPENTRACING_ENABLED
value: "false"
OPENTRACING_SAMPLER_PARAM The default value is 0.01, which means that 1 in 100 traces will be sampled. You can set it to other values. When the OpenTracing function is enabled, you can set the OpenTracing sampler rate.
Example:
- name: OPENTRACING_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_ZIPKIN_V2=http://<ip or host>:<port>/api/v2/spans
For Kubernetes: UA_JAEGER_ENDPOINT_ZIPKIN_V2=http://zipkin.<NAMESPACE>:9411/api/v2/spans
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 9411 for UA_JAEGER_ENDPOINT_ZIPKIN_V2.
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.