In order to enable DEBUG mode when running the Agent as a Kubernetes Daemonset, the following procedure should be applied:
- Edit the instana-agent.yaml file and add the contents of the org.ops4j.pax.logging.cfg file to the instana-configuration ConfigMap after the configuration.yaml file definition (make sure to properly name the file definition and indent)
- Change the value of the log4j2.logger.instana.level from INFO to DEBUG within that section.
- Within the volumeMounts definitions in the Daemonset section, add an additional subPath and mountPath to the volumeMount named configuration:
subPath: org.ops4j.pax.logging.cfg
mountPath: /root/org.ops4j.pax.logging.cfg
After making these changes, delete and reapply the Daemonset. You can verify DEBUG mode is enabled by using the Agent Management Screen in the Instana UI or checking the Agent logs.
If the Agent is deployed using the Helm Chart, please follow this procedure;
- Edit the templates/configmap.yaml and add the contents of the org.ops4j.pax.logging.cfg file to the end (make sure to properly name the file definition and indent).
- Change the value of the log4j2.logger.instana.level from INFO to DEBUG within that section.
- Edit the templates/daemonset.yaml and add an additional subPath and mountPath to the volumeMount named configuration in the volumeMounts section:
subPath: org.ops4j.pax.logging.cfg
mountPath: /root/org.ops4j.pax.logging.cfg
After making these changes, purge and install the Helm Chart. You can verify DEBUG mode is enabled by using the Agent Management Screen in the Instana UI or checking the Agent logs.
The "entire contents" of the cfg file is like this:
https://github.com/instana/instana-agent-docker/blob/master/org.ops4j.pax.logging.cfg
do we place all contents or can one line suffice? this is within configuration.yaml or another file in data:?
would it look something like:
or like:
It's option two with the entire contents of the cfg file
Hi, in step 3, definition of subpath and mountPath we write the following:
- name: logger
subPath: org.ops4j.pax.logging.cfg
mountPath: /root/org.ops4j.pax.logging.cfg
The deployment failed with an error "Not found: "logger""
What's the right way to include it ?
daemonset.yaml:
in spec.spec.containers.volumeMounts:
- name: logger
subPath: org.ops4j.pax.logging.cfg
mountPath: /root/org.ops4j.pax.logging.cfg
then in spec.spec.volumes:
- name: logger
configMap:
name: {{ template "instana-agent.baseName" . }}-configuration
Thank you Ted, let's try your tip.
Thank you Luke :-)