diff options
author | Andrew Dolgov <[email protected]> | 2023-10-20 17:12:29 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2023-10-20 21:13:39 +0300 |
commit | cdd7ad020e165fe680703b6d3319b908b682fb7a (patch) | |
tree | b51eb09b7b4587e8fbc5624ac8d88d28cfcd0b04 /vendor/open-telemetry/sdk/Trace/SpanLimits.php | |
parent | 45a9ff0c88cbd33892ff16ab837e9059937d656e (diff) |
jaeger-client -> opentelemetry
Diffstat (limited to 'vendor/open-telemetry/sdk/Trace/SpanLimits.php')
-rw-r--r-- | vendor/open-telemetry/sdk/Trace/SpanLimits.php | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/vendor/open-telemetry/sdk/Trace/SpanLimits.php b/vendor/open-telemetry/sdk/Trace/SpanLimits.php new file mode 100644 index 000000000..4b07649fc --- /dev/null +++ b/vendor/open-telemetry/sdk/Trace/SpanLimits.php @@ -0,0 +1,67 @@ +<?php + +declare(strict_types=1); + +namespace OpenTelemetry\SDK\Trace; + +use OpenTelemetry\SDK\Common\Attribute\AttributesFactoryInterface; + +final class SpanLimits +{ + public const DEFAULT_SPAN_ATTRIBUTE_LENGTH_LIMIT = PHP_INT_MAX; + public const DEFAULT_SPAN_ATTRIBUTE_COUNT_LIMIT = 128; + public const DEFAULT_SPAN_EVENT_COUNT_LIMIT = 128; + public const DEFAULT_SPAN_LINK_COUNT_LIMIT = 128; + public const DEFAULT_EVENT_ATTRIBUTE_COUNT_LIMIT = 128; + public const DEFAULT_LINK_ATTRIBUTE_COUNT_LIMIT = 128; + + private AttributesFactoryInterface $attributesFactory; + private AttributesFactoryInterface $eventAttributesFactory; + private AttributesFactoryInterface $linkAttributesFactory; + private int $eventCountLimit; + private int $linkCountLimit; + + public function getAttributesFactory(): AttributesFactoryInterface + { + return $this->attributesFactory; + } + + public function getEventAttributesFactory(): AttributesFactoryInterface + { + return $this->eventAttributesFactory; + } + + public function getLinkAttributesFactory(): AttributesFactoryInterface + { + return $this->linkAttributesFactory; + } + + /** @return int Maximum allowed span event count */ + public function getEventCountLimit(): int + { + return $this->eventCountLimit; + } + + /** @return int Maximum allowed span link count */ + public function getLinkCountLimit(): int + { + return $this->linkCountLimit; + } + + /** + * @internal Use {@see SpanLimitsBuilder} to create {@see SpanLimits} instance. + */ + public function __construct( + AttributesFactoryInterface $attributesFactory, + AttributesFactoryInterface $eventAttributesFactory, + AttributesFactoryInterface $linkAttributesFactory, + int $eventCountLimit, + int $linkCountLimit + ) { + $this->attributesFactory = $attributesFactory; + $this->eventAttributesFactory = $eventAttributesFactory; + $this->linkAttributesFactory = $linkAttributesFactory; + $this->eventCountLimit = $eventCountLimit; + $this->linkCountLimit = $linkCountLimit; + } +} |