PHP code example of qualtrics / jaeger-client-php

1. Go to this page and download the library: Download qualtrics/jaeger-client-php 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/ */

    

qualtrics / jaeger-client-php example snippets


use Jaeger\Reporter\RemoteReporter;
use Jaeger\Sampler\ProbabilisticSampler;
use Jaeger\Tracer;
use Jaeger\Transport\JaegerTransport;
use OpenTracing\GlobalTracer;

GlobalTracer::set(Tracer::create("service-name", [
    Tracer::SAMPLER => new ProbabilisticSampler(0.01), // Sample 1% of requests.
    Tracer::REPORTER => new RemoteReporter(new JaegerTransport("127.0.0.1", "5775")), // Send to jaeger-agent on localhost:5775
]));

register_shutdown_function(function() {

    GlobalTracer::get()->flush();

})