pub struct MutableMetadataHandle(/* private fields */);Expand description
A shared handle to a MutableMetadata.
This is a cheap-to-clone Arc<ArcSwap<MutableMetadata>>: all clones observe the same
underlying value. See the
module documentation for the write/read protocol.
Implementations§
Source§impl MutableMetadataHandle
impl MutableMetadataHandle
Sourcepub fn set_identity(&self, runtime_id: String, session: InstrumentationSession)
pub fn set_identity(&self, runtime_id: String, session: InstrumentationSession)
Publish a coherent runtime and session identity, preserving process tags.
After a fork, call while workers are paused, before the child runtime restarts. This does not discard pending observations or reset worker sequence counters.
Sourcepub fn load(&self) -> Guard<Arc<MutableMetadata>>
pub fn load(&self) -> Guard<Arc<MutableMetadata>>
Load the value of the handle
Sourcepub fn load_full(&self) -> Arc<MutableMetadata> ⓘ
pub fn load_full(&self) -> Arc<MutableMetadata> ⓘ
Load the value of the handle, cloned into an owning Arc.
Sourcepub fn set_runtime_id(&self, runtime_id: String)
pub fn set_runtime_id(&self, runtime_id: String)
Set the runtime_id value
Set the process tags value
Sourcepub fn update<F>(&self, f: F)
pub fn update<F>(&self, f: F)
Update the handle value with the result of f.
Use this method to update multiple fields at once. Modify the supplied snapshot rather than replacing it with a previously loaded value. The closure may run more than once when another writer updates the handle concurrently.