Struct xray_lite::Segment

source ·
pub struct Segment {
Show 15 fields pub end_time: Option<Seconds>, pub in_progress: bool, pub parent_id: Option<SegmentId>, pub fault: bool, pub error: bool, pub throttle: bool, pub cause: Option<Cause>, pub origin: Option<String>, pub user: Option<String>, pub resource_arn: Option<String>, pub http: Option<Http>, pub annotations: Option<HashMap<String, Annotation>>, pub metadata: Option<HashMap<String, Value>>, pub aws: Option<Aws>, pub service: Option<Service>, /* private fields */
}
Expand description

Description of an internal application operation which may be an extension of an external operation

Fields§

§end_time: Option<Seconds>

Number that is the time the segment was closed.

§in_progress: bool

boolean, set to true instead of specifying an end_time to record that a segment is started, but is not complete. Send an in-progress segment when your application receives a request that will take a long time to serve, to trace the request receipt. When the response is sent, send the complete segment to overwrite the in-progress segment. Only send one complete segment, and one or zero in-progress segments, per request.

§parent_id: Option<SegmentId>

A subsegment ID you specify if the request originated from an instrumented application. The X-Ray SDK adds the parent subsegment ID to the tracing header for downstream HTTP calls.

§fault: bool

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

§error: bool

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

§throttle: bool

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

§cause: Option<Cause>

error fields that indicate an error occurred and that include information about the exception that caused the error.

§origin: Option<String>

The type of AWS resource running your application. todo: convert to enum (see aws docs for values) When multiple values are applicable to your application, use the one that is most specific. For example, a Multicontainer Docker Elastic Beanstalk environment runs your application on an Amazon ECS container, which in turn runs on an Amazon EC2 instance. In this case you would set the origin to AWS::ElasticBeanstalk::Environment as the environment is the parent of the other two resources.

§user: Option<String>

A string that identifies the user who sent the request.

§resource_arn: Option<String>
§http: Option<Http>

http objects with information about the original HTTP request.

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

§aws: Option<Aws>

aws object with information about the AWS resource on which your application served the request.

§service: Option<Service>

An object with information about your application.

Implementations§

source§

impl Segment

source

pub fn begin<N>(name: N) -> Self
where N: Into<String>,

Begins a new named segment

A segment’s name should match the domain name or logical name of the service that generates the segment. However, this is not enforced. Any application that has permission to PutTraceSegments can send segments with any name.

source

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

End the segment by assigning its end_time

Trait Implementations§

source§

impl Debug for Segment

source§

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

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

impl Default for Segment

source§

fn default() -> Segment

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

impl Serialize for Segment

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