Skip to main content

flareapp_core/
lib.rs

1//! The core of the Flare client: the config, the client, and the worker thread that
2//! sends data to Flare.
3//!
4//! Applications use the `flareapp` crate, which re-exports what they need from
5//! here. Integrations, like the `tracing` integration, use this crate to send their
6//! data through the global [`Client`].
7//!
8//! This crate has no HTTP client of its own. The config needs a [`Transport`]. The
9//! `flareapp` crate sets a default transport.
10
11mod client;
12mod config;
13mod debug;
14mod dotenv;
15mod entry_point;
16mod level;
17mod log_line;
18mod process;
19mod report;
20mod resource;
21mod scope;
22mod source_path;
23mod time;
24mod transport;
25mod worker;
26
27/// Test helpers for the integration crates. Not part of the public API.
28#[cfg(any(test, feature = "testing"))]
29#[doc(hidden)]
30pub mod test_support;
31
32pub use client::{
33    Client, Guard, QueuedReport, StartError, active_client, current, flush, init, is_worker_thread,
34    set_report_listener,
35};
36pub use config::{Config, OtlpProtocol};
37pub use entry_point::EntryPoint;
38#[doc(hidden)]
39pub use entry_point::{
40    SpanEntryPoint, WebRequest, current_span_entry_point, resolve_entry_point, web_entry_point,
41};
42pub use level::Level;
43pub use log_line::{LogLine, LoggedError, Targets, TraceContext};
44#[doc(hidden)]
45pub use process::executable_name;
46pub use process::{command_args, command_line};
47pub use report::{
48    DebugImage, Frame, Report, ReportId, ReportableError, ResolveFrames, StackTrace,
49    erased_exception_class,
50};
51#[doc(hidden)]
52pub use scope::with_nested_entry_point;
53pub use scope::{
54    Scope, ScopeFutureExt, User, WithScope, add_log_breadcrumb, configure_scope, glow, with_scope,
55};
56#[doc(hidden)]
57pub use source_path::{
58    file_crate_name, is_application_file, is_dependency, is_flare_crate, workspace_root,
59};
60pub use transport::{Request, Response, Signal, Transport, TransportError};
61
62/// The name this SDK reports as `telemetry.sdk.name` and in the OTLP scope.
63const SDK_NAME: &str = "flareapp";
64
65/// The version of the Flare crates. All crates in this workspace share it.
66const SDK_VERSION: &str = env!("CARGO_PKG_VERSION");