-
public interface DatadogSpanBuilderBuilder interface for creating instances of DatadogSpan. Provides methods to configure various attributes and context of a Datadog span before initializing it.
-
-
Method Summary
Modifier and Type Method Description abstract DatadogSpanstart()Builds and starts a new span with the current configuration of the builder. abstract DatadogSpanBuilderwithOrigin(String origin)Specifies the origin of the span. abstract DatadogSpanBuilderwithTag(String key, Double value)Adds a tag to the span with the specified key and a nullable double value. abstract DatadogSpanBuilderwithTag(String key, Long value)Adds a tag to the span with the specified key and a nullable long value. abstract DatadogSpanBuilderwithTag(String key, Object value)Adds a tag to the span with the specified key and a nullable value of any type. abstract DatadogSpanBuilderwithResourceName(String resourceName)Specifies the resource name of the span.The resource name is used to describe the operation or endpoint associated with the span. abstract DatadogSpanBuilderwithParentContext(DatadogSpanContext parentContext)Sets the parent context for the span being built. abstract DatadogSpanBuilderwithParentSpan(DatadogSpan parentSpan)Sets the parent span for the span being built. abstract DatadogSpanBuilderwithStartTimestamp(Long micros)Sets the start timestamp for the span being built, specified in microseconds. abstract DatadogSpanBuilderignoreActiveSpan()Prevents builder from using current active span as a parent context. abstract DatadogSpanBuilderwithLink(DatadogSpanLink link)Adds a link to another span in the context of distributed tracing. -
-
Method Detail
-
start
abstract DatadogSpan start()
Builds and starts a new span with the current configuration of the builder.
-
withOrigin
abstract DatadogSpanBuilder withOrigin(String origin)
Specifies the origin of the span. The origin provides metadata about the context or source where the span was created.
- Parameters:
origin- The origin string to associate with the span.
-
withTag
abstract DatadogSpanBuilder withTag(String key, Double value)
Adds a tag to the span with the specified key and a nullable double value. Tags are used to add contextual information to spans, which can later be used for filtering, grouping, or analyzing spans in trace data.
- Parameters:
key- The key identifying the tag.value- The value associated with the tag.
-
withTag
abstract DatadogSpanBuilder withTag(String key, Long value)
Adds a tag to the span with the specified key and a nullable long value. Tags are used to add contextual information to spans, which can later be used for filtering, grouping, or analyzing spans in trace data.
- Parameters:
key- The key identifying the tag.value- The nullable long value associated with the tag.
-
withTag
abstract DatadogSpanBuilder withTag(String key, Object value)
Adds a tag to the span with the specified key and a nullable value of any type. Tags are used to add contextual information to spans, which can later be used for filtering, grouping, or analyzing spans in trace data.
- Parameters:
key- The key identifying the tag.value- The nullable value associated with the tag.
-
withResourceName
abstract DatadogSpanBuilder withResourceName(String resourceName)
Specifies the resource name of the span.The resource name is used to describe the operation or endpoint associated with the span.
- Parameters:
resourceName- The resource name to associate with the span.
-
withParentContext
abstract DatadogSpanBuilder withParentContext(DatadogSpanContext parentContext)
Sets the parent context for the span being built. Allowing to link related operations together.
- Parameters:
parentContext- The parent context to associate with the span.
-
withParentSpan
abstract DatadogSpanBuilder withParentSpan(DatadogSpan parentSpan)
Sets the parent span for the span being built. The default implementation uses parentSpan only for context retrieval.
- Parameters:
parentSpan- The parent span to associate with the span being built.
-
withStartTimestamp
abstract DatadogSpanBuilder withStartTimestamp(Long micros)
Sets the start timestamp for the span being built, specified in microseconds. This value determines the starting point of the span in the overall trace timeline.
- Parameters:
micros- The start timestamp in microseconds.
-
ignoreActiveSpan
abstract DatadogSpanBuilder ignoreActiveSpan()
Prevents builder from using current active span as a parent context.
-
withLink
abstract DatadogSpanBuilder withLink(DatadogSpanLink link)
Adds a link to another span in the context of distributed tracing. This allows associating the current span with an external span, enabling relationship tracking across traces.
- Parameters:
link- The link to be associated with the span.
-
-
-
-