Flare by Spatie
  • Features
  • Pricing
  • Docs
  • Blog
  • LOG IN
  • START TRACKING
  • Home
  • Features
  • Pricing
  • Docs
  • Blog
    • Try Flare for free
    • Sign in
Flare Flare Laravel Laravel PHP PHP JavaScript JavaScript
  • General
  • Introduction
  • Installation
  • Censoring collected data
  • Ignoring collected data
  • Laravel Octane
  • Errors
  • Adding custom context
  • Customising error grouping
  • Handling errors
  • Linking to errors
  • Reporting errors
  • Sending logs to Flare
  • Performance
  • Introduction
  • Sampling
  • Limits
  • Modify spans and span events
  • Data Collection
  • Application info
  • Cache events
  • Console commands
  • Customise error report
  • Database transactions
  • Dumps
  • Errors when tracing
  • Exception context
  • External http requests
  • Filesystem operations
  • Git information
  • Glows
  • Identifying users
  • Jobs and queues
  • Laravel context
  • Livewire
  • Logs
  • Queries
  • Redis commands
  • Requests
  • Server info
  • Solutions
  • Spans
  • Stacktrace arguments
  • Views
  • Older Packages
  • Laravel Flare V1
  • Ignition

Introduction

Flare allows you to run performance monitoring on your application. This means you can see how long certain parts of your code take to execute.

To do this, we'll follow the Open Telemetry tracing standard. Let's give you a quick introduction:

An application always starts a trace for every request, command or job. A sampler decides whether a trace will be sampled based on the sampling rate and a randomiser. When a trace is sampled, spans will be recorded for the trace. A span is a work unit executed within a trace. A span can have a parent span, which means that the span is executed within the timeframe of another span. A span always has a start and end time. Whenever a time-based event happens within a span (with only a single timestamp and no specific start or end time), then we'll call such an event a span event. Sometimes a trace is distributed over multiple machines/services, think a request triggering a queued job. In such a case, the application sends the trace_id, span_id and sampling decision to the next server/service to continue the trace, we call this propagation.

That's it, you're now a tracing expert!

Enabling performance monitoring

To enable performance monitoring, you need to set the trace option to true in the flare.php config file:

'trace' => true,

Starting traces

Flare's Laravel client will automatically start traces when a request, command, or job is processed by a Laravel application. Thus, setting this up requires no manual work.

Collecting spans & span events

The Flare Laravel client will automatically collect all sorts of events within your Laravel application, like:

  • Queries
  • Requests
  • Commands
  • Jobs
  • View
  • External HTTP Requests
  • Logs
  • and so much more ...

In the next chapter, you can read about how we collect data, how to configure data collection and add your own data collectors.

Disabling performance monitoring

Sometimes you might not want to enable performance monitoring for your application. This can be done in the flare.php config file:

'trace' => false,
Sending logs to Flare Sampling
  • On this page
  • Enabling performance monitoring
  • Starting traces
  • Collecting spans & span events
  • Disabling performance monitoring

Monitor your web apps and sites from errors to slowdowns with Flare, the easiest application monitoring platform for Laravel, PHP & Javascript.

  • Platform
  • Error Tracking
  • Performance Monitoring
  • Pricing
  • Support
  • Resources
  • Blog
  • Changelog
  • Documentation
  • Affiliate program
  • Service status
  • Terms of use
  • DPA
  • Privacy & Cookie Policy
Flare