From b6e032be514f8a71088f93a98f7c0271acfa4367 Mon Sep 17 00:00:00 2001 From: Andrey Tkachenko Date: Thu, 12 Dec 2024 09:06:20 +0100 Subject: [PATCH] Update Sdk.php Do not validate instrumentation, if the whole SDK is disabled. --- src/SDK/Sdk.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/SDK/Sdk.php b/src/SDK/Sdk.php index 78f541f64..7d5fd67a9 100644 --- a/src/SDK/Sdk.php +++ b/src/SDK/Sdk.php @@ -35,6 +35,9 @@ public static function isDisabled(): bool */ public static function isInstrumentationDisabled(string $name): bool { + if (static::isDisabled()) { + return true; + } $disabledInstrumentations = Configuration::getList(Variables::OTEL_PHP_DISABLED_INSTRUMENTATIONS); return [self::OTEL_PHP_DISABLED_INSTRUMENTATIONS_ALL] === $disabledInstrumentations || in_array($name, $disabledInstrumentations);