Download the PHP package samuelbednarcik/elastic-apm-agent without Composer
On this page you can find all versions of the php package samuelbednarcik/elastic-apm-agent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download samuelbednarcik/elastic-apm-agent
More information about samuelbednarcik/elastic-apm-agent
Files in samuelbednarcik/elastic-apm-agent
Package elastic-apm-agent
Short Description PHP Agent for Elastic APM
License MIT
Informations about the package elastic-apm-agent
Elastic APM PHP agent
Unofficial PHP agent for Elastic APM (>=6.5). It is no longer maintained, use this package instead.
This package also ships with the helpers for easy integration with your existing project and libraries like Doctrine, Guzzle etc.
Collectors:
Installation
Usage
Create an agent configuration object
Create an agent instance
Call start method as soon as possible in your code. Request start time is retrieved from the REQUEST_TIME_FLOAT server variable. If you don't provide a request instance, it will be created from the global variables. Start method will also return a transaction instance.
Call stop function at the end of the code. Optionally, if you are using symfony request/response, you can use transaction builder to generate a context for the transaction. By calling the stop method, all spans from collectors will be collected. This function will also return a transaction.
After that, you can call sendAll method which will send all informations to APM server.
Span Collectors
Span collectors are used for extracting informations about events which happens in the external libraries like doctrine or guzzle.
You can register collectors when creating an agent instance
Agent will collect spans from all registered collectors after calling the stop method.
Distributed tracing
Distributed tracing headers are automatically handled by the agent, the
only thing you have to do is to send elastic-traceparent-header
in
request which you want to track.
If you are using Guzzle client, you can use TracingGuzzleMiddleware
which will inject header for you.
License
All versions of elastic-apm-agent with dependencies
guzzlehttp/guzzle Version ^6.3
symfony/http-foundation Version ^4.1
symfony/serializer Version ^4.1
symfony/property-info Version ^4.1