namespace App\Services;
use Eerzho\Instrumentation\Class\Attribute\Trace;
use Eerzho\Instrumentation\Class\Attribute\TraceMethod;
use Eerzho\Instrumentation\Class\Attribute\TraceProperties;
#[Trace] // mark the class for tracing
class OrderService
{
// span "App\Services\OrderService::pay"
#[TraceMethod(exclude: ['card'])] // hide "card" from the span
public function pay(int $orderId, string $card, Address $address): void {}
public function healthCheck(): bool {} // no #[TraceMethod] -> not traced
}
#[TraceProperties(exclude: ['zip'])] // expand every prop but zip
class Address
{
public function __construct(public string $city, public string $zip) {}
}