span

Function span 

Source
pub fn span<T>(request: T) -> EnteredSpan
where T: Into<Value>,
Expand description

Creates a new span for tracing.

This function creates a new tracing::span::EnteredSpan based on the provided request. It uses the request to determine the endpoint and includes a unique request ID in the span.

The level of the span is set to ERROR, so it will be included on all log levels.

§Arguments

  • request - A value that can be converted into a Value. Depending on the specific variant of Value, additional information like height, round, or path might be included in the span.

§Returns

An entered span which represents an active or entered span state.

§Examples


let request = request::Value::Info(RequestInfo::default());
let span = span(request);