Procedure for enabling Agent DEBUG mode in a Kubernetes environment

In order to enable DEBUG mode when running the Agent as a Kubernetes Daemonset, the following procedure should be applied:

  1. 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)
  2. Change the value of the log4j2.logger.instana.level from INFO to DEBUG within that section.
  3. 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;

  1. 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).
  2. Change the value of the log4j2.logger.instana.level from INFO to DEBUG within that section.
  3. 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.

Have more questions? Submit a request

Comments

  • Avatar
    Luke Philips

    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:

    apiVersion: v1 
    kind: ConfigMap
    metadata:
    name: {{ template "instana-agent.baseName" . }}-configuration
    labels:
    {{- include "instana-agent.helmChartLabels" . | nindent 4 }}
    data:
    configuration.yaml: |
    # other config..
    #
    # logger:
    org.ops4j.pax.logging.cfg:
    log4j2.logger.instana.level: 'DEBUG'

    or like:

    apiVersion: v1 
    kind: ConfigMap
    metadata:
    name: {{ template "instana-agent.baseName" . }}-configuration
    labels:
    {{- include "instana-agent.helmChartLabels" . | nindent 4 }}
    data:
    configuration.yaml: |
    # other config..
    #

    org.ops4j.pax.logging.cfg: |
    # logger:
    log4j2.logger.instana.level: 'DEBUG'
    Edited by Luke Philips
  • Avatar
    Luke Philips

    It's option two with the entire contents of the cfg file

    Edited by Luke Philips