1. Go to this page and download the library: Download otaodev/opentelemetrytracer 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/ */
otaodev / opentelemetrytracer example snippets
namespace App\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Otaodev\Opentelemetrytracer\Attribute\TraceRoute;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
#[Route('/', name: 'default_')]
class DefaultController extends AbstractController
{
#[Route('/healthcheck', methods: ['GET'])]
#[TraceRoute('any_route_name')]
public function index(): Response
{
$return = $this->json('black tests is ON!');
return $return;
}
}