For me, a bonk is usually accompanied by cramps in the legs and my brain housing group telling me, "you're done for the day, big boy." For me, avoiding the bonk involves attention to fuel and fluids. As I understand it, it's an individual thing, and one has to determine what works for him or her. Fortunately for you, you experienced it early on.
And yes, you did OK, because you finished the ride.
Fuel and fluids. Experiment, and stay with it.