You can also bundle Atatus infra agent inside your docker image, this helps you to monitor process level metrics inside the container along with resource metrics, logs and traces. Following is a sample dockerfile to install Atatus Infrastructure Agent in the docker image.

Dockerfile

For an on-premise server, also add the following keys to /etc/atatus-infra-agent/atatus.yml in the image:
Also, in above file, we used php-fpm as a service. But you can replace it with your process/service command. In Docker, Atatus infra agent won’t start automatically. So you have to add the service atatus-infra-agent start before your process/service command either in ENTRYPOINT/CMD as follows. Using ENTRYPOINT:
Using CMD:
You need to make the following changes to make this work.
  • Change php-fpm to your start application command.
  • Update ATATUS_RELEASE environment variable to latest version of the Atatus PHP agent.
  • Change the license key lic_infra_***************.

Enable Logs

You can collect logs through infra agent by enabling logs_enabled option. In below Dockerfile, we have added the following
  • Set logs_enabled to true.
  • Copy sample files.yml to /etc/atatus-infra-agent/conf.d/files.d/ folder. This file defines from which location/path to collect logs.
files.yml Following is the sample log config file to capture the app logs.
You can change the file path under paths field.