def is_enabled():
    """
    Determine if telemetry is enabled based on environment variables and configuration.
    """
    # Disable telemetry if running in test mode
    if env2bool("DATACHAIN_TEST"):
        return False

    # Check if telemetry is disabled by environment variable
    disabled = bool(os.getenv("DATACHAIN_NO_ANALYTICS"))
    if disabled:
        logger.debug("Telemetry is disabled by environment variable.")
        return False

    logger.debug("Telemetry is enabled.")
    return True

    Determine if telemetry is enabled based on environment variables and configuration.
    
src/datachain/telemetry.py