public static function setCustomVariable($name, $value)
    {
        if ((self::$mode & self::MODE_FULL) === 0 || !is_scalar($value)) {
            return;
        }

        if (!self::$currentRootSpan) {
            return;
        }

        self::$currentRootSpan->annotate(array($name => $value));
    }