Struct xray_lite::Subsegment

source ·
pub struct Subsegment {
Show 17 fields pub trace_id: Option<TraceId>, pub parent_id: Option<SegmentId>, pub in_progress: bool, pub fault: bool, pub error: bool, pub throttled: bool, pub namespace: Option<String>, pub traced: Option<bool>, pub precursor_ids: Option<Vec<String>>, pub cause: Option<Cause>, pub annotations: Option<HashMap<String, Annotation>>, pub metadata: Option<HashMap<String, Value>>, pub type_: String, pub subsegments: Vec<Subsegment>, pub http: Option<Http>, pub aws: Option<AwsOperation>, pub sql: Option<Sql>, /* private fields */
}
Expand description

Record information about the AWS services and resources that your application accesses. X-Ray uses this information to create inferred segments that represent the downstream services in your service map.

Fields§

§trace_id: Option<TraceId>

Trace ID of the subsegment’s parent segment. Required only if sending a subsegment separately.

§parent_id: Option<SegmentId>

Segment ID of the subsegment’s parent segment. Required only if sending a subsegment separately.

§in_progress: bool

boolean that is set to true instead of specifying an end_time to record that a subsegment is started, but is not complete. Only send one complete subsegment, and one or zero in-progress subsegments, per downstream request.

§fault: bool

boolean indicating that a server error occurred (response status code was 5XX Server Error).

§error: bool

boolean indicating that a client error occurred (response status code was 4XX Client Error).

§throttled: bool

boolean indicating that a request was throttled (response status code was 429 Too Many Requests).

§namespace: Option<String>

aws for AWS SDK calls; remote for other downstream calls.

§traced: Option<bool>
§precursor_ids: Option<Vec<String>>

array of subsegment IDs that identifies subsegments with the same parent that completed prior to this subsegment.

§cause: Option<Cause>

information about the cause of an error

§annotations: Option<HashMap<String, Annotation>>

annotations object with key-value pairs that you want X-Ray to index for search.

§metadata: Option<HashMap<String, Value>>

metadata object with any additional data that you want to store in the segment.

§type_: String

subsegment. Required only if sending a subsegment separately.

§subsegments: Vec<Subsegment>

array of subsegment objects.

§http: Option<Http>

http object with information about an outgoing HTTP call.

§aws: Option<AwsOperation>

aws object with information about the downstream AWS resource that your application called.

§sql: Option<Sql>

contents of the sql query

Implementations§

source§

impl Subsegment

source

pub fn begin<N>( trace_id: TraceId, parent_id: Option<SegmentId>, name: N ) -> Self
where N: Into<String>,

Create a new subsegment

source

pub fn end(&mut self) -> &mut Self

End the subsegment by assigning its end_time

Trait Implementations§

source§

impl Debug for Subsegment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Subsegment

source§

fn default() -> Subsegment

Returns the “default value” for a type. Read more
source§

impl Serialize for Subsegment

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V