Struct 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>( name: N, id: SegmentId, parent_id: Option<SegmentId>, trace_id: TraceId, ) -> 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
Source§

impl Visit for Subsegment

Source§

fn record_str(&mut self, field: &Field, value: &str)

Visit a string value.
Source§

fn record_debug(&mut self, field: &Field, value: &dyn Debug)

Visit a value implementing fmt::Debug.
Source§

fn record_f64(&mut self, field: &Field, value: f64)

Visit a double-precision floating point value.
Source§

fn record_i64(&mut self, field: &Field, value: i64)

Visit a signed 64-bit integer value.
Source§

fn record_u64(&mut self, field: &Field, value: u64)

Visit an unsigned 64-bit integer value.
Source§

fn record_i128(&mut self, field: &Field, value: i128)

Visit a signed 128-bit integer value.
Source§

fn record_u128(&mut self, field: &Field, value: u128)

Visit an unsigned 128-bit integer value.
Source§

fn record_bool(&mut self, field: &Field, value: bool)

Visit a boolean value.
Source§

fn record_bytes(&mut self, field: &Field, value: &[u8])

Visit a byte slice.
Source§

fn record_error(&mut self, field: &Field, value: &(dyn Error + 'static))

Records a type implementing Error. 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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>,

Source§

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>,

Source§

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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more