Download the PHP package ditliti/laravel-sdk without Composer
On this page you can find all versions of the php package ditliti/laravel-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ditliti/laravel-sdk
More information about ditliti/laravel-sdk
Files in ditliti/laravel-sdk
Package laravel-sdk
Short Description Official Laravel exception reporter SDK for Ditliti (self-hosted error tracking, tracing, replays, and profiling ingestion).
License MIT
Homepage https://github.com/kangartha/inspectora/tree/main/sdk/php-laravel
Informations about the package laravel-sdk
ditliti/laravel-sdk
Official Laravel SDK for Ditliti - error tracking, tracing, session replay, and profiling ingestion.
This SDK talks to a self-hosted Ditliti instance (ingestion-api). It does not connect to any managed/hosted service - point it at your own deployment's ingestion URL.
Install
The artifact repository is the canonical fallback until Packagist confirms publication.
Ditliti\Laravel\DitlitiServiceProvider auto-registers via Laravel package discovery.
Configuration
Add to config/ditliti.php (or set directly via .env + config() calls):
Once registered, unhandled exceptions are reported automatically via
Laravel's exception handler reportable() hook.
Manual usage
API
DitlitiClient::report(Throwable $exception, array $context = [], array $options = [])DitlitiClient::sendEnvelope(array $envelope)- low-level batch submit.DitlitiClient::captureReplaySegment(float $durationMs, array $events, array $options = [])DitlitiClient::captureProfile(int $durationMs, array $samples, array $options = [])DitlitiClient::withTrace(?string $incomingTraceparent = null): self,getTraceparent(),startSpan(...)- see Distributed tracing below.
Distributed tracing
Generates real W3C traceparent (https://www.w3.org/TR/trace-context/) trace context, so a trace can be propagated across service/microservice boundaries instead of staying siloed per project. DitlitiClient is immutable (all constructor properties are readonly), so withTrace() returns a new client instance carrying the trace rather than mutating the existing one - in a middleware, rebind it into the container for the rest of the request:
$client->withTrace(?string $incomingTraceparent = null): self- returns a new client that starts a new trace, or continues one from an inboundtraceparentheader.$client->getTraceparent(): ?string- the header value to forward on outgoing requests.$client->startSpan(string $operationName, array $tags = []): Span→$span->finish(array $extraTags = []).
Database query instrumentation (Database Insights)
Set DITLITI_TRACE_QUERIES=true (config('ditliti.trace_queries')) to auto-instrument every query - query builder, Eloquent, and raw DB:: calls alike - via Laravel's own DB::listen hook, with no query wrapping required:
With this enabled, DitlitiServiceProvider::boot() calls Ditliti\Laravel\DbTracing::listen($client), which records every executed query as a db.query span (db.system.name from the connection's driver, db.query.text the real SQL - the backend parameterizes and hashes it server-side). Failed queries surface via Laravel's QueryException, reported through the same reportable() hook as error.type.
To call these directly instead of via config (e.g. to scope it to one connection):
License
MIT - see LICENSE.