Customizing the JBoss data collector
You can set the variables to change the default behavior of the JBoss data collector.
User-defined environment variables for the JBoss data collector. For JBoss monitoring in Kubernetes environment, 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.
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: jboss_kitchensink |
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 JBoss 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. 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" |
Example of a yaml
file:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
creationTimestamp: 2018-05-05T13:00:27Z
generation: 1
labels:
app: wildflyapp-selector
name: wildflyapp-deployment
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: wildflyapp-selector
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: wildflyapp-selector
spec:
containers:
- env:
- name: APPLICATION_NAME
value: jboss_kitchensink
- name: LOG_REST_PAYLOAD
value: "true"
- name: IBM_APM_RESTCLIENT_LOGLEVEL
value: DEBUG_MAX
- name: JAEGER_SAMPLER_TYPE
value: "probabilistic"
- name: JAEGER_SAMPLER_PARAM
value: "0.9"
- name: OPENTRACING_ENABLED
value: "true"
image: mycluster.icp:8500/default/jbossapp:1.0
imagePullPolicy: Always
name: wildflyapp
readinessProbe:
failureThreshold: 3
httpGet:
path: /
port: 8080
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- name: global-environment
mountPath: /opt/ibm/apm/serverconfig
volumes:
- name: global-environment
secret:
secretName: jboss-dc-secret
optional: true
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30