PHP code example of cascata / hyperf-opentelemetry
1. Go to this page and download the library: Download cascata/hyperf-opentelemetry 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/ */
cascata / hyperf-opentelemetry example snippets
return [
'http' => [
\Cascata\HyperfOpenTelemetry\Middleware\CorrelationIdMiddleware::class,
\Cascata\HyperfOpenTelemetry\Middleware\TracingMiddleware::class,
// ... your other middlewares
],
];
use Cascata\HyperfOpenTelemetry\Tracing\Annotation\Traced;
class CreateUser
{
#[Traced(name: 'usecase.user.create')]
public function execute(CreateUserInput $input): CreateUserOutput
{
// automatic span: usecase.user.create
}
}