Package io.opentelemetry.sdk.trace
Class SpanLimitsBuilder
java.lang.Object
io.opentelemetry.sdk.trace.SpanLimitsBuilder
Builder for
SpanLimits
.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private static final int
private static final int
private int
private int
private int
private int
private int
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds and returns aSpanLimits
with the values of this builder.setMaxAttributeValueLength
(int maxAttributeValueLength) Sets the max number of characters for string attribute values.setMaxNumberOfAttributes
(int maxNumberOfAttributes) Sets the max number of attributes perSpan
.setMaxNumberOfAttributesPerEvent
(int maxNumberOfAttributesPerEvent) Sets the max number of attributes per event.setMaxNumberOfAttributesPerLink
(int maxNumberOfAttributesPerLink) Sets the max number of attributes per link.setMaxNumberOfEvents
(int maxNumberOfEvents) Sets the max number of events perSpan
.setMaxNumberOfLinks
(int maxNumberOfLinks) Sets the max number of links perSpan
.
-
Field Details
-
DEFAULT_SPAN_MAX_NUM_ATTRIBUTES
private static final int DEFAULT_SPAN_MAX_NUM_ATTRIBUTES- See Also:
-
DEFAULT_SPAN_MAX_NUM_EVENTS
private static final int DEFAULT_SPAN_MAX_NUM_EVENTS- See Also:
-
DEFAULT_SPAN_MAX_NUM_LINKS
private static final int DEFAULT_SPAN_MAX_NUM_LINKS- See Also:
-
DEFAULT_SPAN_MAX_NUM_ATTRIBUTES_PER_EVENT
private static final int DEFAULT_SPAN_MAX_NUM_ATTRIBUTES_PER_EVENT- See Also:
-
DEFAULT_SPAN_MAX_NUM_ATTRIBUTES_PER_LINK
private static final int DEFAULT_SPAN_MAX_NUM_ATTRIBUTES_PER_LINK- See Also:
-
maxNumAttributes
private int maxNumAttributes -
maxNumEvents
private int maxNumEvents -
maxNumLinks
private int maxNumLinks -
maxNumAttributesPerEvent
private int maxNumAttributesPerEvent -
maxNumAttributesPerLink
private int maxNumAttributesPerLink -
maxAttributeValueLength
private int maxAttributeValueLength
-
-
Constructor Details
-
SpanLimitsBuilder
SpanLimitsBuilder()
-
-
Method Details
-
setMaxNumberOfAttributes
Sets the max number of attributes perSpan
.- Parameters:
maxNumberOfAttributes
- the max number of attributes perSpan
. Must be positive.- Returns:
- this.
- Throws:
IllegalArgumentException
- ifmaxNumberOfAttributes
is not positive.
-
setMaxNumberOfEvents
Sets the max number of events perSpan
.- Parameters:
maxNumberOfEvents
- the max number of events perSpan
. Must be positive.- Returns:
- this.
- Throws:
IllegalArgumentException
- ifmaxNumberOfEvents
is not positive.
-
setMaxNumberOfLinks
Sets the max number of links perSpan
.- Parameters:
maxNumberOfLinks
- the max number of links perSpan
. Must be positive.- Returns:
- this.
- Throws:
IllegalArgumentException
- ifmaxNumberOfLinks
is not positive.
-
setMaxNumberOfAttributesPerEvent
Sets the max number of attributes per event.- Parameters:
maxNumberOfAttributesPerEvent
- the max number of attributes per event. Must be positive.- Returns:
- this.
- Throws:
IllegalArgumentException
- ifmaxNumberOfAttributesPerEvent
is not positive.
-
setMaxNumberOfAttributesPerLink
Sets the max number of attributes per link.- Parameters:
maxNumberOfAttributesPerLink
- the max number of attributes per link. Must be positive.- Returns:
- this.
- Throws:
IllegalArgumentException
- ifmaxNumberOfAttributesPerLink
is not positive.
-
setMaxAttributeValueLength
Sets the max number of characters for string attribute values. For string array attribute values, applies to each entry individually.- Parameters:
maxAttributeValueLength
- the max number of characters for attribute strings. Must not be negative.- Returns:
- this.
- Throws:
IllegalArgumentException
- ifmaxAttributeValueLength
is negative.
-
build
Builds and returns aSpanLimits
with the values of this builder.
-