Flare by Spatie
    • Error Tracking
    • Performance Monitoring
    • Logs
  • Pricing
  • Docs
  • Insights
  • Changelog
  • Back to Flare ⌘↵ Shortcut: Command or Control Enter
  • Sign in
  • Try Flare for free
  • Error Tracking
  • Performance Monitoring
  • Logs
  • Pricing
  • Docs
  • Insights
  • Changelog
    • Back to Flare ⌘↵ Shortcut: Command or Control Enter
    • Try Flare for free
    • Sign in
Flare Flare PHP PHP JavaScript JavaScript Protocol Protocol
JavaScript
  • PHP
  • JavaScript
  • General
  • Introduction
  • Sending data
  • Events
  • Errors
  • Attributes
  • Sourcemaps
  • Traces
  • Lifecycle
  • Web vitals
  • Aggregations
  • Shared by all clients
  • Entry points
  • Resources
  • Attribute formats
  • Errors payload
  • Traces payload
  • Logs payload

Introduction

View as Markdown

This chapter covers the parts of the Flare protocol that only apply to a browser client. Read it alongside the shared pages, which describe the payload structure itself.

Where things live

The three ingestion endpoints and the way you encode attributes are the same for every client, whatever language it is written in. Those pages sit under Shared by all clients in the sidebar:

  • Entry points for saying which page or request a report belongs to.
  • Resources for the attributes describing your application.
  • Attribute formats for the OpenTelemetry value encoding.
  • Errors payload, Traces payload and Logs payload for the endpoints themselves.

The pages in this chapter cover what a browser does differently:

  • Sending data for the public key, the origin allowlist, timestamps and the last batch before the page closes.
  • Events for the browser span types and their attributes.
  • Attributes for the page context on an error report.
  • Sourcemaps for turning minified stack frames back into readable ones.
  • Lifecycle, Web vitals and Aggregations for how browser traces are shaped and grouped.

What a browser does differently

The key is public. A browser cannot keep a secret, so a browser client sends with the project's public key, and the project decides which domains may use it.

A page view is the unit of work. Traces are rooted in a page load or a client-side navigation instead of a request or a job.

Some data shows up after the trace has closed. Core Web Vitals are not final when the page finishes loading, so they go out later, in a second request, on a span backdated to the page's start.

The route pattern takes work. A server framework knows its route from routing. In the browser you either get a pattern out of the router or you fall back to the raw path, and you record which one happened.

Stack frames are minified. Column numbers and a source map version are what make them readable again.

Building a client

Implement the errors, traces and logs endpoints, then follow the attribute conventions in this chapter and in the shared pages.

The span types here are shaped around what a browser can actually observe. If your framework needs a span type or a grouping that does not exist yet, send us a mail and we will look at adding it.

Sending data

On this page

  • Where things live
  • What a browser does differently
  • Building a client

Catch errors and fix slowdowns with Flare, the full-stack application monitoring platform for Laravel, PHP & JavaScript.

  • Platform
  • Error Tracking
  • Performance Monitoring
  • Pricing
  • Support
  • Resources
  • Insights
  • Newsletter
  • Changelog
  • Documentation
  • Affiliate program
  • uptime status badge Service status
  • Terms of use
  • DPA
  • Privacy & cookie Policy
Made in by Spatie logo
Flare