Enable debug logging for the hawkular-metrics component in OpenShift

Solution Unverified - Updated

Environment

  • Red Hat OpenShift Container Platform
    • 3.4
    • 3.5
    • 3.6

Issue

  • Whats wrong with hawkular-metrics
  • How do I enable debug logging for hawkular-metrics?
  • I need more information from the hawkular-metrics pod

Resolution

  • To enable debug logging for the hawkular-metrics component, you will need to modify the replicationController (RC) for hawkular-metrics and add an environment variable with the name ADDITIONAL_LOGGING and the value of org.hawkular.openshift.auth=DEBUG
    • You can manually edit the rc oc edit rc hawkular-metrics and add that to the file or use the following command to drop it into place:
oc env rc/hawkular-metrics ADDITIONAL_LOGGING="org.hawkular.metrics=DEBUG,org.hawkular.alerts=DEBUG"
  • After you add this environment variable you should scale your hawkular-metrics pod down to 0 and then back up to 1.
oc scale rc hawkular-metrics --replicas=0
oc scale rc hawkular-metrics --replicas=1

Diagnostic Steps

To verify that the variable was added, you can check the yaml of the RC or the pod. You can run the following command to do so:

oc get rc hawkular-metrics -o yaml | grep LOGGING -B10 -A 5
SBR
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.