https://twitter.com/BERTILLONClment
https://github.com/skigun
What ? What is wrong ?
The product page of the production
So it come from the Backoffice ?
No, it probably come from the MarketPlace
No it come from our provider app who synchronize data in real time
Yes but no, now that we migrate products on ElasticSearch it should come from the new MicroService.. no ? and why logs say nothing?
It doesn't work !
E-commerce
Backoffice
ElasticSearch
MarketPlace
Product MicroService
CRM
Subvention MicroService
Application Log
Raw Log
Difficult
User Interface test
Target a server with a header
curl GET 'https://e-commerce.com'
--header 'X-Server-number: 1'
ModHeader
We know a web page crashes
but we cannot find which application is responsible for
Distributed tracing, also called distributed request tracing, is a method used to profile and monitor applications, mainly those built using a distributed architecture.
Feature: Distributed Profiling
Issue #1
Client HTTP involved : HTTP_Request2
Configure the library with curl (standard)
Inject the blackfire header
in the request
Documentation
Issue #2
https://blog.blackfire.io/the-power-of-distributed-profiling.html
$request = new HttpRequest2Iso(RACINE_BO_MEYCLUB.'synchro_ag.php', 'POST');
// vs
$request = new HttpRequest2Iso(RACINE_BO_MEYCLUB.'synchro_ag.php', 'POST', [
'adapter'=> 'HTTP_Request2_Adapter_Curl'
]);
// If the workflow start from application A
// We want to stop the propagation of Http calls
if ($this->httpTracer->getLastOriginFromRequest($masterRequest)) {
return;
}
services:
Monolog\Processor\UidProcessor:
tags: ['monolog.processor']
<?php
class HttpTracer
{
private const HEADER_ORIGIN = 'trace-origin';
private const HEADER_ID = 'trace-id';
public function traceOrigin(&$headers): void
{
}
public function traceId(&$headers): void
{
$headers[self::HEADER_ID] ?? $headers[self::HEADER_ID] = md5(random_bytes(10));
}
public function getLastOriginFromRequest(Request $request): ?string
{
}
}
https://github.com/auxmoney/OpentracingBundle-core
Tracing::injectTracingHeaders($request): RequestInterface
OpenTracing
OpenTelemetry
High-quality, ubiquitous, and portable telemetry to enable effective observability
# config/packages/dev/web_profiler.yaml
framework:
profiler:
only_exceptions: false
dsn: 'file:/shared_profiler_directory/var/profiler'
# config/packages/dev/web_profiler.yaml
framework:
profiler:
only_exceptions: false
dsn: 'file:/shared_profiler_directory/var/profiler'
https://twitter.com/BERTILLONClment
https://github.com/skigun