Traces | Metrics | App Logs | Custom Logs | Profiling |
---|---|---|---|---|
- | - | - |
Before installing this agent, you need to install PHP-Extension(named otel_instrumentation) to run this agent. You can follow below steps to install & enable it:
extension=opentelemetry.so
to your php.ini
file (depending on which Linux distribution you’re using):
Ubuntu/Debian:
CentOS/RHEL:
Arch Linux:
Specific to the Web-Serve:
While installing PHP-Extension:
pecl:command not found
, then you need to run follow cmd:
libpcre2-dev : Depends: libpcre2-8-0 / libpcre2-16-0 / libpcre2-32-0
, then you need to run follow cmd:
ERROR: 'phpize' failed
, then you need to run follow cmd:
Make sure you have a PHP project set up and a composer.json
file in your project’s root directory. If you don’t have one, you can create it using composer init
. Run below command in your terminal to install Middleware’s APM-PHP package.
Add these lines given below at the very start of your project.
By using the APM Collector, you will start tracing-scope before your code, Also you need to register your hooks along with initial declaration. In each hook, you need to define your Classes & Functions name, so whenever they run, agent will track them auto.
After your code-flow, you need to end the tracing scope, so that agent can send the data to Middleware’s APM dashboard.
If you want to enable Logging feature along with tracing in your project, then you can use below code snippet.
If you are using APM in a Kubernetes cluster make sure to follow these 2 steps:
For older setup, your “mw-service” can be inside mw-agent-ns-{FIRST-5-LETTERS-OF-API-KEY}
namespace
For newer setup, we simplified the namespace name to mw-agent-ns
Traces | Metrics | App Logs | Custom Logs | Profiling |
---|---|---|---|---|
- | - | - |
Before installing this agent, you need to install PHP-Extension(named otel_instrumentation) to run this agent. You can follow below steps to install & enable it:
extension=opentelemetry.so
to your php.ini
file (depending on which Linux distribution you’re using):
Ubuntu/Debian:
CentOS/RHEL:
Arch Linux:
Specific to the Web-Serve:
While installing PHP-Extension:
pecl:command not found
, then you need to run follow cmd:
libpcre2-dev : Depends: libpcre2-8-0 / libpcre2-16-0 / libpcre2-32-0
, then you need to run follow cmd:
ERROR: 'phpize' failed
, then you need to run follow cmd:
Make sure you have a PHP project set up and a composer.json
file in your project’s root directory. If you don’t have one, you can create it using composer init
. Run below command in your terminal to install Middleware’s APM-PHP package.
Add these lines given below at the very start of your project.
By using the APM Collector, you will start tracing-scope before your code, Also you need to register your hooks along with initial declaration. In each hook, you need to define your Classes & Functions name, so whenever they run, agent will track them auto.
After your code-flow, you need to end the tracing scope, so that agent can send the data to Middleware’s APM dashboard.
If you want to enable Logging feature along with tracing in your project, then you can use below code snippet.
If you are using APM in a Kubernetes cluster make sure to follow these 2 steps:
For older setup, your “mw-service” can be inside mw-agent-ns-{FIRST-5-LETTERS-OF-API-KEY}
namespace
For newer setup, we simplified the namespace name to mw-agent-ns