pub struct AwsSpanBuilder<'a> { /* private fields */ }
Expand description
Builder for creating AWS-specific OpenTelemetry spans.
This builder provides a fluent interface for constructing spans with AWS-specific attributes and proper span kinds for different types of AWS operations.
Implementations§
Source§impl AwsSpanBuilder<'_>
impl AwsSpanBuilder<'_>
Sourcepub fn dynamodb(
method: impl Into<StringValue>,
table_names: impl IntoIterator<Item = impl Into<StringValue>>,
) -> Self
pub fn dynamodb( method: impl Into<StringValue>, table_names: impl IntoIterator<Item = impl Into<StringValue>>, ) -> Self
Creates a DynamoDB operation span builder.
This method creates a span builder configured for DynamoDB operations with appropriate semantic attributes according to OpenTelemetry conventions.
§Arguments
method
- The DynamoDB operation method name (e.g., “GetItem”, “PutItem”)table_names
- Iterator of table names involved in the operation
§Returns
A configured AWS span builder for the DynamoDB operation
Source§impl AwsSpanBuilder<'_>
impl AwsSpanBuilder<'_>
Sourcepub fn firehose(
operation_kind: MessagingOperationKind,
method: impl Into<StringValue>,
stream_name: Option<impl Into<StringValue>>,
) -> Self
pub fn firehose( operation_kind: MessagingOperationKind, method: impl Into<StringValue>, stream_name: Option<impl Into<StringValue>>, ) -> Self
Creates a Firehose operation span builder.
This method creates a span builder configured for Firehose operations with appropriate messaging semantic attributes.
§Arguments
operation_kind
- The type of messaging operation being performedmethod
- The Firehose operation method namestream_name
- Optional stream name for operations that target specific streams
Source§impl AwsSpanBuilder<'_>
impl AwsSpanBuilder<'_>
Sourcepub fn sns(
operation_kind: MessagingOperationKind,
method: impl Into<StringValue>,
topic_arn: Option<impl Into<StringValue>>,
) -> Self
pub fn sns( operation_kind: MessagingOperationKind, method: impl Into<StringValue>, topic_arn: Option<impl Into<StringValue>>, ) -> Self
Creates an SNS operation span builder.
This method creates a span builder configured for SNS operations with appropriate messaging semantic attributes.
§Arguments
operation_kind
- The type of messaging operation being performedmethod
- The SNS operation method nametopic_arn
- Optional topic ARN for operations that target specific topics
Source§impl<'a> AwsSpanBuilder<'a>
impl<'a> AwsSpanBuilder<'a>
Sourcepub fn client(
service: impl Into<StringValue>,
method: impl Into<StringValue>,
attributes: impl IntoIterator<Item = KeyValue>,
) -> Self
pub fn client( service: impl Into<StringValue>, method: impl Into<StringValue>, attributes: impl IntoIterator<Item = KeyValue>, ) -> Self
Creates a client span builder for AWS operations.
Client spans represent outbound calls to AWS services from your application.
§Arguments
service
- The AWS service name (e.g., “S3”, “DynamoDB”)method
- The operation name (e.g., “GetObject”, “PutItem”)attributes
- Additional custom attributes for the span
Sourcepub fn producer(
service: impl Into<StringValue>,
method: impl Into<StringValue>,
attributes: impl IntoIterator<Item = KeyValue>,
) -> Self
pub fn producer( service: impl Into<StringValue>, method: impl Into<StringValue>, attributes: impl IntoIterator<Item = KeyValue>, ) -> Self
Creates a producer span builder for AWS operations.
Producer spans represent operations that send messages or data to AWS services.
§Arguments
service
- The AWS service name (e.g., “SQS”, “SNS”)method
- The operation name (e.g., “SendMessage”, “Publish”)attributes
- Additional custom attributes for the span
Sourcepub fn consumer(
service: impl Into<StringValue>,
method: impl Into<StringValue>,
attributes: impl IntoIterator<Item = KeyValue>,
) -> Self
pub fn consumer( service: impl Into<StringValue>, method: impl Into<StringValue>, attributes: impl IntoIterator<Item = KeyValue>, ) -> Self
Creates a consumer span builder for AWS operations.
Consumer spans represent operations that receive messages or data from AWS services.
§Arguments
service
- The AWS service name (e.g., “SQS”, “Kinesis”)method
- The operation name (e.g., “ReceiveMessage”, “GetRecords”)attributes
- Additional custom attributes for the span
Sourcepub fn attributes(self, iter: impl IntoIterator<Item = KeyValue>) -> Self
pub fn attributes(self, iter: impl IntoIterator<Item = KeyValue>) -> Self
Adds multiple attributes to the span being built.
§Arguments
iter
- An iterator of key-value attributes to add to the span
Sourcepub fn attribute(self, attribute: KeyValue) -> Self
pub fn attribute(self, attribute: KeyValue) -> Self
Adds a single attribute to the span being built.
This is a convenience method for adding one attribute at a time.
§Arguments
attribute
- The key-value attribute to add to the span
Sourcepub fn context(self, context: &'a Context) -> Self
pub fn context(self, context: &'a Context) -> Self
Sets the parent context for the span.
§Arguments
context
- The OpenTelemetry context to use as the parent
Sourcepub fn set_context(self, context: Option<&'a Context>) -> Self
pub fn set_context(self, context: Option<&'a Context>) -> Self
Optionally sets the parent context for the span.
§Arguments
context
- An optional OpenTelemetry context to use as the parent
Auto Trait Implementations§
impl<'a> Freeze for AwsSpanBuilder<'a>
impl<'a> !RefUnwindSafe for AwsSpanBuilder<'a>
impl<'a> Send for AwsSpanBuilder<'a>
impl<'a> Sync for AwsSpanBuilder<'a>
impl<'a> Unpin for AwsSpanBuilder<'a>
impl<'a> !UnwindSafe for AwsSpanBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request