1. Go to this page and download the library: Download utopia-php/telemetry 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/ */
utopia-php / telemetry example snippets
topia\Telemetry\Adapter\OpenTelemetry;
$telemetry = new OpenTelemetry('http://localhost:4318/v1/metrics', 'namespace', 'app', 'unique-instance-id');
// Periodically collect and export metrics to the configured OpenTelemetry endpoint.
$telemetry->collect();
// Example using Swoole
\Swoole\Timer::tick(60_000, fn () => $telemetry->collect());