tavsec / laravel-opentelemetry
Laravel package for OpenTelemetry implementation
0.2.2
2023-05-22 14:05 UTC
Requires
- guzzlehttp/promises: ^1.5
- open-telemetry/api: ^0.0.17
- open-telemetry/exporter-zipkin: ^0.0.17
- open-telemetry/sdk: ^0.0.17
- php-http/message-factory: ^1.1
Requires (Dev)
- orchestra/testbench: ^8.0
README
This package provides OTEL exporter for Laravel applications.
Usage
Middleware
Middleware will track requests and export them to OTEL.
Add OpenTelemetryMiddleware
to app/Http/Kernel.php
file, at the end of $middleware
array.
protected $middleware = [ // ... OpenTelemetryMiddleware::class ];
Additional metrics/spans
$tracing = (new OpenTelemetry)->startSpan("<SPAN-NAME>", [ "att1" => "foo", "att2" => "bar" ]); sleep(200); $tracing->endSpan();
Current reports
- Cache hit/miss
- Request parameters
- Eloquent queries