Expand description
The core of the Flare client: the config, the client, and the worker thread that sends data to Flare.
Applications use the flareapp crate, which re-exports what they need from
here. Integrations, like the tracing integration, use this crate to send their
data through the global Client.
This crate has no HTTP client of its own. The config needs a Transport. The
flareapp crate sets a default transport.
Structs§
- Client
- Hands telemetry to the worker thread and controls the thread’s lifetime.
- Config
- Settings for the Flare client.
- Debug
Image - A binary or library that was loaded in the app when the report was made.
- Entry
Point - What started the work that a report, log or trace belongs to: a web request, a command, or a queued job. Flare requires an entry point, and groups and filters by it.
- Frame
- One line of a stack trace.
- Guard
- A handle that keeps the Flare client running.
initreturns the guard. - LogLine
- A log line, in the shape every logging integration can produce.
- Logged
Error - An error that a log line carries, like the
errorfield of atracingevent. - Queued
Report - The parts of a queued error report that the report listener gets. See
set_report_listener. - Report
- One error, panic or message, on its way to Flare.
- Report
Id - The id of one report, a random UUID. Flare calls it the tracking UUID.
- Request
- An HTTP
POSTrequest to Flare, ready to send. - Response
- The parts of an HTTP response that the Flare client needs: the status, the retry time and the body.
- Scope
- The user, context, attributes, entry point, glows and log breadcrumbs that reports include.
- Stack
Trace - A stack trace after the worker thread resolved it.
- Targets
- Where
LogLine::senddelivers a line. - Trace
Context - The trace and span a log line belongs to.
- Transport
Error - The error for a request that got no HTTP response, like a connection failure or a timeout.
- User
- The user that was logged in when an error happened.
- With
Scope - A future that runs with its own scope. Create it with
ScopeFutureExt::with_flare_scope.
Enums§
- Level
- How serious a message or glow is. These are the levels Flare knows, the same as the PSR-3 log levels in PHP.
- Otlp
Protocol - How logs and traces are encoded before they are sent. Set it with
Config::otlp_protocol. - Signal
- The kind of data in a request. Each kind goes to its own endpoint.
- Start
Error - The reason why
Client::startdid not start a client.
Traits§
- Reportable
Error - An error that the Flare client can report: an error type that does not borrow
data, or a
dyn Error. - Resolve
Frames - A captured stack trace that is not resolved yet.
- Scope
Future Ext - Gives a future its own scope, so the user, context and breadcrumbs of one
request stay with that request, across every
.await. - Transport
- Sends requests to Flare. Implement this trait to send data with your own HTTP client.
Functions§
- active_
client - Returns the global client, unless this is the worker thread.
- add_
log_ breadcrumb - Records a log line as a breadcrumb in the current scope. The logging
integrations call this function. Error reports then show the line on their
timeline, with
fieldsas the context of the line. - command_
args - Returns the arguments this process was started with, starting with the program.
- command_
line - Returns the command line of this process: the arguments joined by spaces.
- configure_
scope - Changes the current scope.
- current
- Returns the global client, or
Nonewhen the Flare client is not running. - erased_
exception_ class - Returns the exception class for an error whose type is hidden, like the error
in a
Box<dyn Error>or the root cause of ananyhow::Error. - flush
- Waits until all queued logs, spans and error reports are sent, or until
timeouthas passed. Returnstruewhen nothing is left to send. - glow
- Adds a glow: a breadcrumb that shows up on the timeline of the next reports.
- init
- Starts the Flare client and returns a guard that keeps it running.
- is_
worker_ thread - Returns
trueon the worker thread. Integrations use this function to skip their work on the worker thread, because the worker thread must not wait for itself. - set_
report_ listener - Sets a function that gets every report that the client queued. Only the first call has an effect.
- with_
scope - Runs
workwith an extra scope on the current thread, and removes that scope afterwards, also whenworkpanics.