PHP code example of megaease / easeagent-sdk-php
1. Go to this page and download the library: Download megaease/easeagent-sdk-php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
megaease / easeagent-sdk-php example snippets
use Easeagent\AgentBuilder;
// new tracing agent from yaml file.
// If you want to publish the `docker app` through the `cloud of megaease` and send the monitoring data to the `cloud`,
// please obtain the configuration file path through the environment variable `EASEAGENT_CONFIG`.
// We will pass it to you the `cloud configuration` file path.
$agent = AgentBuilder::buildFromYaml(getenv('EASEAGENT_CONFIG'));//by default: Console Reporter
$agent->serverReceive(function ($span) use ($agent) {
echo "<p>Welcome to PHP</p>";
});
bash
$ composer