Melatonin gives me the weirdest nightmares.
Katzen, if you're in early sobriety I'd say do all you can and then accept that sleep is erratic in early days.
It was about a month before I slept consistently through the night for 7-9 hours. Prior to that I would sleep three hours and be up, then one day crash for 12 hours. It takes time.
Do all you (naturally) can to facilitate sleep though. You can Google "Sleep Hygiene" for tried and true tricks, but for me it comes down to the basics: good nutrition during the day and 30-60 minutes of some moderate activity. Low caffeine consumption. Low sugar consumption.
Sleep will come, my body makes me sleep when I need it.
The cure for anything is salt water: sweat, tears, or the sea.
~ Isak Dinesen