Requests
Flare can collect information about the requests being made to your application. This includes:
- The request method
- The request URL
- The body size & contents
- The user agent
- The IP address of the user
- The request headers
- The request cookies
- The request query parameters
- The request files
- The request session data
- The request route
- The request route parameters
- The request route metadata
- Livewire components
- The authenticated user
This functionality is enabled by default, but you can disable it by ignoring the Requests collect in config.php:
use Spatie\FlareClient\Enums\CollectType;
'collects' => FlareConfig::defaultCollects(
ignore: [CollectType::Requests],
),
It is possible to filter out fields from the request body, headers, and the user's IP address. You can read more about this here.
Route metadata
Laravel route metadata lets you attach application-specific context to a route, such as a page title or feature flag:
use Illuminate\Support\Facades\Route;
Route::get('/users', fn () => view('users.index'))
->metadata(['head' => ['title' => 'Users']]);
Within a request to that route, you can read nested values with request()->route()->getMetadata('head.title').
Flare collects this metadata with the request. In error details, look under Routing → Metadata. In performance monitoring, open the request span and look under Route → Metadata. Both expose the route context, although nested values may be displayed differently.
Ignoring specific requests
You can drop traces for individual URLs, paths, or routes by adding patterns to the Requests collect in config.php. When a request matches, the trace is unsampled and no spans are sent for it.
use Spatie\FlareClient\Enums\CollectType;
'collects' => FlareConfig::defaultCollects(
extra: [
CollectType::Requests->value => [
'ignored_routes' => ['horizon.*', 'telescope.*'],
'ignored_urls' => ['https://example.com/internal/*'],
'ignored_paths' => ['/health-check', '/metrics/*'],
],
],
),
Patterns are literal strings with * as a wildcard. Routes are matched once Laravel has resolved the route name, so route patterns are evaluated through deferred sampling.
By default, livewire components passed to the request are also collected. This can be disabled by ignoring the Livewire collect in config.php:
use Spatie\LaravelFlare\Enums\LaravelCollectType;
'collects' => FlareConfig::defaultCollects(
ignore: [LaravelCollectType::LivewireComponents],
),
Grouping unmatched route errors
When a request hits a URL that doesn't match any registered route (for example, bots scanning for wp-admin.php), Flare will automatically set the http.route attribute to errors::{status_code} (e.g. errors::404). This groups all unmatched 4xx requests under a single route label instead of cluttering your dashboard with individual URLs.
This behavior is enabled by default. You can disable it in config.php:
use Spatie\FlareClient\Enums\CollectType;
'collects' => FlareConfig::defaultCollects(
extra: [
CollectType::Requests->value => [
'group_unmatched_route_errors' => false,
],
],
),