public Attributes getAttributes()

in common/src/main/java/co/elastic/otel/common/MutableSpanData.java [66:85]


  public Attributes getAttributes() {

    Attributes original = super.getAttributes();
    if (attributeOverrides == null || attributeOverrides.isEmpty()) {
      return original;
    }
    if (cachedMutatedAttributes == null) {
      AttributesBuilder attributesBuilder = Attributes.builder().putAll(original);
      for (AttributeKey overrideKey : attributeOverrides.keySet()) {
        Object value = attributeOverrides.get(overrideKey);
        if (value == null) {
          attributesBuilder.remove(overrideKey);
        } else {
          attributesBuilder.put(overrideKey, value);
        }
      }
      cachedMutatedAttributes = attributesBuilder.build();
    }
    return cachedMutatedAttributes;
  }