pub struct AwsSpanBuilder<'a> { /* private fields */ }
Expand description
Builder for creating AWS-specific OpenTelemetry spans.
This builder provides a fluent interface for constructing AwsSpan
with
required attributes and proper span kinds for different types of AWS operations.
It automatically sets standard RPC attributes following OpenTelemetry semantic
conventions for AWS services.
§Usage
This builder can be used with AwsInstrument
trait to instrument any AWS operation,
or to manually create AwsSpan
if you need control over span lifecycle.
For automatic instrumentation, use AwsBuilderInstrument
trait.
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 AwsSpanBuilder<'_>
impl AwsSpanBuilder<'_>
Sourcepub fn sqs(
operation_kind: MessagingOperationKind,
method: impl Into<StringValue>,
queue: Option<impl Into<StringValue>>,
) -> Self
pub fn sqs( operation_kind: MessagingOperationKind, method: impl Into<StringValue>, queue: Option<impl Into<StringValue>>, ) -> Self
Creates an SQS operation span builder.
This method creates a span builder configured for SQS operations with appropriate messaging semantic attributes.
§Arguments
operation_kind
- The type of messaging operation being performedmethod
- The SQS operation method namequeue
- Optional SQS queue URL or name for operations that target specific queues
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
Sourcepub fn set_context(self, context: Option<&'a Context>) -> Self
pub fn set_context(self, context: Option<&'a Context>) -> Self
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