Dramatic irony is when the reader knows things the characters don’t. It abounds in literature and film, from horror (he’s right behind you!) to drama and romance.
Dramatic irony can also destroy a good story when there’s poor justification for it. If two characters who are typically honest could clear up the major plot point of the book by having a 5-minute conversation, the book is likely to be frustrating to readers. “Just have the conversation already! Ugh!”
The best use of dramatic irony (in my ever-humble opinion) is to let the reader see what’s happening in ways that enhance anticipation of the characters discovering these secrets. It is the opposite of keeping secrets from the reader.
We should be thinking “How will the characters react when they find out?” rather than “How are all the characters missing this obvious thing, avoiding this obvious solution, acting unlike themselves to have this false drama?”