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 Details

    • DEFAULT

      public static final SpanLimits 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 keeps
      maxAttributeValueLength - the characters a string value keeps
      maxEvents - the events a span keeps
      maxAttributesPerEvent - the attributes an event keeps
      Throws:
      IllegalArgumentException - if one is negative, or the length is zero
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • maxAttributes

      public int maxAttributes()
      Returns the value of the maxAttributes record component.
      Returns:
      the value of the maxAttributes record component
    • maxAttributeValueLength

      public int maxAttributeValueLength()
      Returns the value of the maxAttributeValueLength record component.
      Returns:
      the value of the maxAttributeValueLength record component
    • maxEvents

      public int maxEvents()
      Returns the value of the maxEvents record component.
      Returns:
      the value of the maxEvents record component
    • maxAttributesPerEvent

      public int maxAttributesPerEvent()
      Returns the value of the maxAttributesPerEvent record component.
      Returns:
      the value of the maxAttributesPerEvent record component