Package io.opentelemetry.sdk.trace
Class SpanLimitsBuilder
java.lang.Object
io.opentelemetry.sdk.trace.SpanLimitsBuilder
Builder for
SpanLimits.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns aSpanLimitswith 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.
-
Method Details
-
setMaxNumberOfAttributes
Sets the max number of attributes perSpan.- Parameters:
maxNumberOfAttributes- the max number of attributes perSpan. Must not be negative.- Returns:
- this.
- Throws:
IllegalArgumentException- ifmaxNumberOfAttributesis negative.
-
setMaxNumberOfEvents
Sets the max number of events perSpan.- Parameters:
maxNumberOfEvents- the max number of events perSpan. Must not be negative.- Returns:
- this.
- Throws:
IllegalArgumentException- ifmaxNumberOfEventsis negative.
-
setMaxNumberOfLinks
Sets the max number of links perSpan.- Parameters:
maxNumberOfLinks- the max number of links perSpan. Must not be negative.- Returns:
- this.
- Throws:
IllegalArgumentException- ifmaxNumberOfLinksis negative.
-
setMaxNumberOfAttributesPerEvent
Sets the max number of attributes per event.- Parameters:
maxNumberOfAttributesPerEvent- the max number of attributes per event. Must not be negative.- Returns:
- this.
- Throws:
IllegalArgumentException- ifmaxNumberOfAttributesPerEventis negative.
-
setMaxNumberOfAttributesPerLink
Sets the max number of attributes per link.- Parameters:
maxNumberOfAttributesPerLink- the max number of attributes per link. Must not be negative.- Returns:
- this.
- Throws:
IllegalArgumentException- ifmaxNumberOfAttributesPerLinkis negative.
-
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- ifmaxAttributeValueLengthis negative.
-
build
Builds and returns aSpanLimitswith the values of this builder.
-