Package org.microproxy.otel
Record Class SpanLimits
java.lang.Object
java.lang.Record
org.microproxy.otel.SpanLimits
- Record Components:
maxAttributes- the attributes a span keeps (OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT, 128)maxAttributeValueLength- the characters a string value keeps (OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT, 4096)maxEvents- the events a span keeps (OTEL_SPAN_EVENT_COUNT_LIMIT, 128)maxAttributesPerEvent- the attributes an event keeps (OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT, 128)
public record SpanLimits(int maxAttributes, int maxAttributeValueLength, int maxEvents, int maxAttributesPerEvent)
extends Record
Bounds on what one span (or log record) keeps, so that attributes a script or a request supplies
cannot grow it without limit: past them, attributes and events are dropped and counted as
dropped in the export, and longer string values are cut. The defaults are OpenTelemetry's, but
for the value length, which OpenTelemetry leaves unbounded.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SpanLimitsThe defaults: 128 attributes of up to 4096 characters, 128 events of up to 128 attributes. -
Constructor Summary
ConstructorsConstructorDescriptionSpanLimits(int maxAttributes, int maxAttributeValueLength, int maxEvents, int maxAttributesPerEvent) Checks the limits. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of themaxAttributesrecord component.intReturns the value of themaxAttributesPerEventrecord component.intReturns the value of themaxAttributeValueLengthrecord component.intReturns the value of themaxEventsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT
The defaults: 128 attributes of up to 4096 characters, 128 events of up to 128 attributes.
-
-
Constructor Details
-
SpanLimits
public SpanLimits(int maxAttributes, int maxAttributeValueLength, int maxEvents, int maxAttributesPerEvent) Checks the limits.- Parameters:
maxAttributes- the attributes a span keepsmaxAttributeValueLength- the characters a string value keepsmaxEvents- the events a span keepsmaxAttributesPerEvent- the attributes an event keeps- Throws:
IllegalArgumentException- if one is negative, or the length is zero
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
maxAttributes
public int maxAttributes()Returns the value of themaxAttributesrecord component.- Returns:
- the value of the
maxAttributesrecord component
-
maxAttributeValueLength
public int maxAttributeValueLength()Returns the value of themaxAttributeValueLengthrecord component.- Returns:
- the value of the
maxAttributeValueLengthrecord component
-
maxEvents
public int maxEvents()Returns the value of themaxEventsrecord component.- Returns:
- the value of the
maxEventsrecord component
-
maxAttributesPerEvent
public int maxAttributesPerEvent()Returns the value of themaxAttributesPerEventrecord component.- Returns:
- the value of the
maxAttributesPerEventrecord component
-