Standalone reporter
When the reporter type is grpc or kafka, the skywalking_agent extension forks a child process during
the extension initialization phase to act as a worker process for sending data to the SkyWalking OAP server
or Kafka.
However, this approach has some limitations, such as:
- It cannot be used with the
php-fpmdaemon mode. - Multiple worker processes can be redundant when there are several
php-fpmprocesses on the instance.
To address these issues, skywalking_agent introduces a new reporter type: standalone.
With the standalone reporter type, the skywalking_agent extension no longer forks a child process.
Instead, the user needs to manually start an independent worker process.
Steps
-
Compile the standalone
skywalking-php-workerbinary:cargo build -p skywalking-php-worker --bin skywalking-php-worker --all-features --release -
Run
skywalking-php-worker:Assuming the socket file path is
/tmp/skywalking-php-worker.sockand the SkyWalking OAP server address is127.0.0.1:11800, the command is:./target/release/skywalking-php-worker -s /tmp/skywalking-php-worker.sock grpc --server-addr 127.0.0.1:11800For additional parameters, refer to
./target/release/skywalking-php-worker --help. -
Configure
php.ini:[skywalking_agent] extension = skywalking_agent.so skywalking_agent.reporter_type = standalone skywalking_agent.standalone_socket_path = /tmp/skywalking-php-worker.sock