City are in control of the last-16 tie ahead of the return leg on March 15, but at several moments during the first leg, their European destiny appeared to be hanging by a thread.
Guardiola's side went ahead, fell 2-1 and then 3-2 down, but finally rallied with three goals in the last 19 minutes from Sergio Aguero, who scored a brace, John Stones and Leroy Sane.
Fernandinho return big boost for City, claims De Bruyne
"A lot of things happened, but in the moment we were lucky. We were stable mentally," Guardiola told BT Sport at the Etihad Stadium. "The old and young guys in the team played amazing. To live this experience helps us a lot in the future.
"Monaco has more history than us in the competition and you need this kind of experience to learn and improve. Of course anything can happen in Monaco and we have to score goals. We think in attack: attack, attack, attack."
He added: "The result is OK. It could be better, could be worse, but it is what it is."
Manchester City's Kompany out of last-16 first leg against Monaco
Radamel Falcao scored twice for Monaco, in addition to a goal by 18-year-old Kylian Mbappe, but saw a second-half penalty saved by City goalkeeper Willy Caballero with the visitors 2-1 up.
"The first thing I say is today is one of the most exciting games in the Champions League this year," said Monaco coach Leonardo Jardim. "For the supporters it's very good. I think everyone stayed happy, watching the two teams.
"There was lots of attacking quality, eight goals. I think today Monaco played a great game. I've congratulated the players. But there were little defensive errors. The key moment of the game was the chance to go 3-1 up that we missed. Then our opponents made it 2-2."
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ