pub struct SpanAttributesBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> SpanAttributesBuilder<S>
impl<S: State> SpanAttributesBuilder<S>
Sourcepub fn build(self) -> SpanAttributeswhere
S: IsComplete,
pub fn build(self) -> SpanAttributeswhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn kind(self, value: String) -> SpanAttributesBuilder<SetKind<S>>where
S::Kind: IsUnset,
pub fn kind(self, value: String) -> SpanAttributesBuilder<SetKind<S>>where
S::Kind: IsUnset,
Sourcepub fn maybe_kind(
self,
value: Option<String>,
) -> SpanAttributesBuilder<SetKind<S>>where
S::Kind: IsUnset,
pub fn maybe_kind(
self,
value: Option<String>,
) -> SpanAttributesBuilder<SetKind<S>>where
S::Kind: IsUnset,
Sourcepub fn span_name(self, value: String) -> SpanAttributesBuilder<SetSpanName<S>>where
S::SpanName: IsUnset,
pub fn span_name(self, value: String) -> SpanAttributesBuilder<SetSpanName<S>>where
S::SpanName: IsUnset,
Sourcepub fn maybe_span_name(
self,
value: Option<String>,
) -> SpanAttributesBuilder<SetSpanName<S>>where
S::SpanName: IsUnset,
pub fn maybe_span_name(
self,
value: Option<String>,
) -> SpanAttributesBuilder<SetSpanName<S>>where
S::SpanName: IsUnset,
Sourcepub fn attributes(
self,
value: HashMap<String, Value>,
) -> SpanAttributesBuilder<SetAttributes<S>>where
S::Attributes: IsUnset,
pub fn attributes(
self,
value: HashMap<String, Value>,
) -> SpanAttributesBuilder<SetAttributes<S>>where
S::Attributes: IsUnset,
Optional (Some / Option setters). Default: <HashMap<String, Value> as Default>::default().
Custom attributes to add to the span. Follow OpenTelemetry semantic conventions for naming: https://opentelemetry.io/docs/specs/semconv/
Sourcepub fn maybe_attributes(
self,
value: Option<HashMap<String, Value>>,
) -> SpanAttributesBuilder<SetAttributes<S>>where
S::Attributes: IsUnset,
pub fn maybe_attributes(
self,
value: Option<HashMap<String, Value>>,
) -> SpanAttributesBuilder<SetAttributes<S>>where
S::Attributes: IsUnset,
Optional (Some / Option setters). Default: <HashMap<String, Value> as Default>::default().
Custom attributes to add to the span. Follow OpenTelemetry semantic conventions for naming: https://opentelemetry.io/docs/specs/semconv/
Sourcepub fn links(self, value: Vec<Link>) -> SpanAttributesBuilder<SetLinks<S>>where
S::Links: IsUnset,
pub fn links(self, value: Vec<Link>) -> SpanAttributesBuilder<SetLinks<S>>where
S::Links: IsUnset,
Sourcepub fn maybe_links(
self,
value: Option<Vec<Link>>,
) -> SpanAttributesBuilder<SetLinks<S>>where
S::Links: IsUnset,
pub fn maybe_links(
self,
value: Option<Vec<Link>>,
) -> SpanAttributesBuilder<SetLinks<S>>where
S::Links: IsUnset,
Sourcepub fn carrier(
self,
value: HashMap<String, String>,
) -> SpanAttributesBuilder<SetCarrier<S>>where
S::Carrier: IsUnset,
pub fn carrier(
self,
value: HashMap<String, String>,
) -> SpanAttributesBuilder<SetCarrier<S>>where
S::Carrier: IsUnset,
Optional (Some / Option setters).
Optional carrier headers for context propagation. Supports both W3C Trace Context and AWS X-Ray formats:
traceparent: W3C format containing trace ID, span ID, and trace flagstracestate: W3C vendor-specific trace informationx-amzn-trace-id: AWS X-Ray trace header format
Sourcepub fn maybe_carrier(
self,
value: Option<HashMap<String, String>>,
) -> SpanAttributesBuilder<SetCarrier<S>>where
S::Carrier: IsUnset,
pub fn maybe_carrier(
self,
value: Option<HashMap<String, String>>,
) -> SpanAttributesBuilder<SetCarrier<S>>where
S::Carrier: IsUnset,
Optional (Some / Option setters).
Optional carrier headers for context propagation. Supports both W3C Trace Context and AWS X-Ray formats:
traceparent: W3C format containing trace ID, span ID, and trace flagstracestate: W3C vendor-specific trace informationx-amzn-trace-id: AWS X-Ray trace header format
Sourcepub fn trigger(self, value: String) -> SpanAttributesBuilder<SetTrigger<S>>where
S::Trigger: IsUnset,
pub fn trigger(self, value: String) -> SpanAttributesBuilder<SetTrigger<S>>where
S::Trigger: IsUnset,
Sourcepub fn maybe_trigger(
self,
value: Option<String>,
) -> SpanAttributesBuilder<SetTrigger<S>>where
S::Trigger: IsUnset,
pub fn maybe_trigger(
self,
value: Option<String>,
) -> SpanAttributesBuilder<SetTrigger<S>>where
S::Trigger: IsUnset,
Auto Trait Implementations§
impl<S> Freeze for SpanAttributesBuilder<S>
impl<S> RefUnwindSafe for SpanAttributesBuilder<S>
impl<S> Send for SpanAttributesBuilder<S>
impl<S> Sync for SpanAttributesBuilder<S>
impl<S> Unpin for SpanAttributesBuilder<S>
impl<S> UnwindSafe for SpanAttributesBuilder<S>
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> 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> 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