Skip to content

Commit

Permalink
fix example (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
weslenteche authored Apr 1, 2024
1 parent a91cca7 commit 7371e07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/instrumentation/Psr18/request.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use GuzzleHttp\Psr7\Request;
use OpenTelemetry\API\Instrumentation;
use OpenTelemetry\API\Trace\Propagation\TraceContextPropagator;
use OpenTelemetry\SDK\Common\Export\Stream\StreamTransportFactory;
use OpenTelemetry\SDK\Common\Time\ClockFactory;
use OpenTelemetry\SDK\Resource\ResourceInfoFactory;
use OpenTelemetry\SDK\Trace\Sampler\AlwaysOnSampler;
Expand All @@ -15,8 +16,11 @@

require_once dirname(__DIR__, 3) . '/vendor/autoload.php';

$transport = (new StreamTransportFactory())->create('php://output', 'application/json');
$exporter = new ConsoleSpanExporter($transport);

$tracerProvider = new TracerProvider(
new BatchSpanProcessor(new ConsoleSpanExporter(), ClockFactory::getDefault()),
new BatchSpanProcessor($exporter, ClockFactory::getDefault()),
new AlwaysOnSampler(),
ResourceInfoFactory::emptyResource(),
);
Expand Down

0 comments on commit 7371e07

Please sign in to comment.