It all depends on if you truly want to get off drugs. I started seeing my therapist after I went through an outpatient rehab program, and I told her about my history of opiate abuse and even told her about my psychedelic use, which had a direct role in me turning to opiates. These are all things I need help getting over, and I am seeing her to treat these exact issues, so why wouldn't I tell her about all of it? Fortunately, my therapist has used psychedelics in the past (yes, I got lucky) so she understands when I tell her about my experiences with those substances. This makes it makes it easier for us to communicate about such topics, naturally. But regardless of my past opiate addiction, I think if I were in a situation where I was in extreme pain and actually NEEDED the relief that a strong pain-killer would provide, she wouldn't stop me from getting a prescription for said pain-killer.
In the end, if you truly want to get better and get past addiction and all of the other issues in your life, then you have to do two things: 1st. Find a therapist (and psychiatrist if need be) that you REALLY trust, and 2nd. Tell that therapist (and psychiatrist) EVERYTHING, even about that time you were sitting at your computer in your bedroom late at night, jerking it to cartoon porn, when all of a sudden your older sister walked in to uncover your deepest secret... (no, this did not happen to me, but you get the point! lol)