APM

PHP Setup

  • Install with source
COPY ./apm-agent-php /apm-agent-php/
RUN true \
&& apt -y update \
&& apt install libcurl4-gnutls-dev \
&& cd /apm-agent-php/src/ext \
&& phpize \
&& CFLAGS="-std=gnu99" ./configure --enable-elastic_apm \
&& make clean \
&& make \
&& make install \
&& apt-get purge -y \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \
&& true
  • Install with pkg
RUN true \
&& curl --silent --show-error --fail --location --retry 3 --remote-name https://github.com/elastic/apm-agent-php/releases/download/v0.3/apm-agent-php_0.3_all.deb \
&& dpkg --install apm-agent-php_0.3_all.deb \
&& apt-get purge -y \
&& apt-get autoremove --purge -y \
&& rm -rf /var/lib/apt/lists/* \
&& true

# dpkg-query -L apm-agent-php
  • php.ini changes
auto_globals_jit = Off
extension=/opt/elastic/apm-agent-php/extensions/elastic_apm-20190902.so
elastic_apm.bootstrap_php_part_file=/opt/elastic/apm-agent-php/src/bootstrap_php_part.php