Medical treatments for chronic insomnia include numerous medications and non medication treatment such as cognitive behavioral therapy (CBT). Getting a better night's sleep with or without taking sleeping medication will require an investigation into several issues: First, are there reasons why you have trouble sleeping? Pain, anxiety, noise, medications for other disorders, etc. Next, you want to make certain that the medications you are prescribed are truly "sleeping medications" which have been FDA approved for insomnia. Many medications which have drowsiness as a side effect and are often used for insomnia (Benadryl, trazodone, etc.) adversely affect sleep patterns and do not lead to restorative sleep.
Menopause and perimenopausal periods are often associated with insomnia. The cause is unknown but many feel it is related to abnormal temperature regulation. Heat, for example is not conducive to sleep whereas cooler temperatures are conducive to sleep. Often, lowering the temperature in your bedroom will facilitate sleep (68-72 degrees) You may be getting enough sleep time but not true restorative sleep which would account for your daytime performance. There are medications which help to increase restorative sleep, not just sleep, but good sleep. A sleep study can be helpful if you are sleeping some and have awakenings which could be secondary to sleep disordered breathing or leg movements. A sleep study will also reveal if you are getting restorative sleep and consolidated, not fragmented, sleep.
Once the above issues have been addressed, you may be a candidate the Cognitive Behavioral Therapy (CBT) which teaches relaxation and imaging techniques to induce sleep. This therapy, often in combination with low doses of a sleep aide, can help patients with insomnia for which no obvious cause can be found, "primary insomnia". Your primary care physician can make the appropriate referral for the above.