Start by peeling and slicing your onions thinly. Heat the olive oil and butter in a large skillet over medium heat. Once melted, add the onions along with the granulated sugar, salt, and pepper. Stir occasionally as they cook for about 20-25 minutes until they are golden brown and caramelized.
Once the onions are beautifully caramelized, stir in the balsamic vinegar and thyme. Cook for an additional 2-3 minutes until the vinegar has mostly evaporated and everything is well combined.
In a mixing bowl, combine softened cream cheese, grated Gruyère cheese, grated Parmesan cheese, egg, and heavy cream (or crème fraîche). Mix until smooth and creamy.
Preheat your oven to 375°F (190°C) while you prepare your pie crusts. Roll them out according to package instructions if using refrigerated crusts.
Lay out your pie crust in a tart pan or cut rounds if you're making individual tarts. Spread a generous layer of the cheese filling on the base of each tart shell, followed by an even amount of caramelized onions on top.
Place your assembled tarts in the preheated oven and let them bake for about 25-30 minutes or until golden brown and bubbly on top.
Once out of the oven, let them cool slightly before garnishing with fresh thyme sprigs and drizzling some balsamic glaze on top.