How to get Instana agent logs from different deployments/environments

This article outlines methods to get agent logs from different environments when Instana support/engineering requests this information. This information helps to troubleshoot the issue in hand.

 

Getting "agent logs" for Linux Host:

The agent logs are located at <instana_install_dir>/data/logs

Simply zip up this directory and post the zip file to the ticket.

 

Getting "agent logs" for Windows Host:

The agent logs are located at: 

C:\Program Files\Instana\instana-agent\data\log

Simply zip up this directory and post the zip file to the ticket.

 

Getting "agent debug logs" for Linux Host:

- Stop the agent (/bin/stop.sh)

- Wipe the logs (delete all files in /data/logs)

- Set log level to DEBUG (change the severity in the configuration file

following the instructions here:

https://docs.instana.io/quick_start/agent_configuration/#agent-logging-configuration

- Start the agent (/bin/start.sh)

- Reproduce the issue

- Zip up the logs (in /data/logs) and post the zip file to the ticket

 

Getting "agent debug logs" for Windows Host:

- Stop the agent (C:\Program Files\Instana\instana-agent\bin\stop.bat)

- Wipe the logs (delete all files in C:\Program Files\Instana\instana-agent\data\log)

- Set log level to DEBUG (change the severity in the configuration file

following the instructions here:

https://docs.instana.io/quick_start/agent_configuration/#agent-logging-configuration 

configuration file location C:\Program Files\Instana\instana-agent\etc\org.ops4j.pax.logging.cfg)

- Start the agent (C:\Program Files\Instana\instana-agent\bin\start.bat)

- Reproduce the issue

- Zip up the logs (in C:\Program Files\Instana\instana-agent\data\log) and post the zip file to the ticket 

 

Getting "agent logs" from a container

By default, the Instana Agent will log to <instana_install_dir>/data/log/agent.log, which will also be rotated should the file grow too large. If you are running the agent in a container, it logs to the console instead, which is managed by Docker and accessible via docker logs. You can run the below command to get the logs for the container:

docker logs <container>

 

Getting "agent logs" from Kubernetes namespace: 

Could you please use the below script to get the logs of all instana-agents in your cluster. It will output all logs in directory "instana-agent-logs" which can be zipped and sent back to us.

 

Content of the script is below:

mkdir instana-agent-logs

for p in $(kubectl get pods --namespace instana-agent | cut -f 1 -d ' '); do

if [[ $p != "NAME" ]]

then

kubectl logs $p -c instana-agent --namespace instana-agent > instana-agent-logs/$p-instana-agent.log

kubectl logs $p -c instana-agent-leader-elector --namespace instana-agent > instana-agent-logs/$p-instana-agent-leader-elector.log

Fi

 

Getting logs for troubleshooting an on-prem server related issue:

Please provide the:

  1. Output of instana-debug and
  2. Archive generated by the command that is documented here:

https://docs.instana.io/quick_start/on_prem_ap/activating_debug_mode/#general-debug-logs

 

Have more questions? Submit a request

Comments