Skip to main content

Crate flareapp_core

Crate flareapp_core 

Source
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.
DebugImage
A binary or library that was loaded in the app when the report was made.
EntryPoint
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. init returns the guard.
LogLine
A log line, in the shape every logging integration can produce.
LoggedError
An error that a log line carries, like the error field of a tracing event.
QueuedReport
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.
ReportId
The id of one report, a random UUID. Flare calls it the tracking UUID.
Request
An HTTP POST request 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.
StackTrace
A stack trace after the worker thread resolved it.
Targets
Where LogLine::send delivers a line.
TraceContext
The trace and span a log line belongs to.
TransportError
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.
WithScope
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.
OtlpProtocol
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.
StartError
The reason why Client::start did not start a client.

Traits§

ReportableError
An error that the Flare client can report: an error type that does not borrow data, or a dyn Error.
ResolveFrames
A captured stack trace that is not resolved yet.
ScopeFutureExt
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 fields as 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 None when 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 an anyhow::Error.
flush
Waits until all queued logs, spans and error reports are sent, or until timeout has passed. Returns true when 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 true on 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 work with an extra scope on the current thread, and removes that scope afterwards, also when work panics.