Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LogRecordLimitsBuilder.php

class LogRecordLimitsBuilder

Hierarchy

  • class \OpenTelemetry\SDK\Logs\LogRecordLimitsBuilder

Expanded class hierarchy of LogRecordLimitsBuilder

File

vendor/open-telemetry/sdk/Logs/LogRecordLimitsBuilder.php, line 12

Namespace

OpenTelemetry\SDK\Logs
View source
class LogRecordLimitsBuilder {
    
    /** @var ?int Maximum allowed attribute count per record */
    private ?int $attributeCountLimit = null;
    
    /** @var ?int Maximum allowed attribute value length */
    private ?int $attributeValueLengthLimit = null;
    
    /**
     * @param int $attributeCountLimit Maximum allowed attribute count per record
     */
    public function setAttributeCountLimit(int $attributeCountLimit) : LogRecordLimitsBuilder {
        $this->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);
    }

}

Members

Title Sort descending Modifiers Object type Summary
LogRecordLimitsBuilder::$attributeCountLimit private property @var ?int Maximum allowed attribute count per record
LogRecordLimitsBuilder::$attributeValueLengthLimit private property @var ?int Maximum allowed attribute value length
LogRecordLimitsBuilder::build public function
LogRecordLimitsBuilder::setAttributeCountLimit public function
LogRecordLimitsBuilder::setAttributeValueLengthLimit public function
RSS feed
Powered by Drupal