attributeCountLimit = $attributeCountLimit; return $this; } /** * @param int $attributeValueLengthLimit Maximum allowed attribute value length */ public function setAttributeValueLengthLimit(int $attributeValueLengthLimit): LogRecordLimitsBuilder { $this->attributeValueLengthLimit = $attributeValueLengthLimit; return $this; } /** * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#attribute-limits */ public function build(): LogRecordLimits { $attributeCountLimit = $this->attributeCountLimit ?: Configuration::getInt(Variables::OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT); $attributeValueLengthLimit = $this->attributeValueLengthLimit ?: Configuration::getInt(Variables::OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT); if ($attributeValueLengthLimit === PHP_INT_MAX) { $attributeValueLengthLimit = null; } $attributesFactory = Attributes::factory($attributeCountLimit, $attributeValueLengthLimit); return new LogRecordLimits($attributesFactory); } }