Distributed tracing with Jaeger between Symfony (PHP) Microservices

126 views Asked by At

I am testing Jaeger for our microservices written in PHP (Symfony) and found this cool lib for Symfony https://github.com/auxmoney?q=opentracingbundle. Great work!

I installed OpentracingBundle-Jaeger and configured it. I checked in their code (in the core lib), that they enabled the traces for Controllers and Commands only. I checked with one test controller and here is what I have right now.

The Controller:

<?php

declare(strict_types=1);

namespace App\Controller;

use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

class MyController extends AbstractController
{
    #[Route('/ping', name: 'my_ping_route')]
    public function index(): Response
    {
        return $this->returnResponse();
    }

    public function returnResponse(): Response
    {
        // some process delay
        sleep(3);

        return new Response('Hello, Jaeger!');
    }
}

The Output in Jaeger:

enter image description here

What I am wondering right now is: I was expected, that in Jaeger I will see 3 Spans, because the App\Controller\MyController::index() method is calling inside the App\Controller\MyController::returnResponse() method, where exactly the delay happens.

Does someone knows why this is not displayed? Or maybe I am missing the point of Jaeger and it is not so much detailed as I am expecting and it is used maybe only for tracing the global calls between the microservices.

0

There are 0 answers