pub struct Scope { /* private fields */ }Expand description
The user, context, attributes, entry point, glows and log breadcrumbs that reports include.
Change it with configure_scope, with_scope or
ScopeFutureExt::with_flare_scope.
Implementations§
Source§impl Scope
impl Scope
Sourcepub fn remove_user(&mut self)
pub fn remove_user(&mut self)
Removes the user, for example after a logout.
Sourcepub fn set_context<K: Into<String>, V: Into<Value>>(&mut self, key: K, value: V)
pub fn set_context<K: Into<String>, V: Into<Value>>(&mut self, key: K, value: V)
Adds a piece of context, shown under “custom context” in Flare.
§Examples
flareapp_core::configure_scope(|scope| {
scope.set_context("order", serde_json::json!({ "id": 7 }));
});Sourcepub fn remove_context(&mut self, key: &str)
pub fn remove_context(&mut self, key: &str)
Removes a piece of context.
Sourcepub fn set_attribute<K: Into<String>, V: Into<Value>>(
&mut self,
key: K,
value: V,
)
pub fn set_attribute<K: Into<String>, V: Into<Value>>( &mut self, key: K, value: V, )
Sets an attribute that reports include as it is, like http.request.method.
Integrations use this for request data.
Sourcepub fn set_entry_point(&mut self, entry_point: EntryPoint)
pub fn set_entry_point(&mut self, entry_point: EntryPoint)
Sets what started the current work: a web request, a command or a job.
Inside with_scope or ScopeFutureExt::with_flare_scope, this entry
point wins over the entry point of any tracing span. In the app-wide
scope, this entry point comes after the spans, so a job span still names
its own job. Without an entry point anywhere, the Flare client uses the
command line of the process. The docs of EntryPoint explain the order.