Skip to content

Commit

Permalink
Update Sdk.php
Browse files Browse the repository at this point in the history
Do not validate instrumentation, if the whole SDK is disabled.
  • Loading branch information
profuel authored Dec 12, 2024
1 parent 4a021fb commit b6e032b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/SDK/Sdk.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b6e032b

Please sign in to comment.