  The concept of ergodicity---the convergence of the temporal averages of
observables to their ensemble averages---is the cornerstone of thermodynamics.
The transition from a predictable, integrable behavior to ergodicity is one of
the most difficult physical phenomena to treat; the celebrated KAM theorem is
the prime example. This Letter is founded on the observation that for many
classical and quantum observables, the sum of the ensemble variance of the
temporal average and the ensemble average of temporal variance remains constant
across the integrability-ergodicity transition.
  We show that this property induces a particular geometry of quantum
observables---Frobenius (also known as Hilbert-Schmidt) one---that naturally
encodes all the phenomena associated with the emergence of ergodicity: the
Eigenstate Thermalization effect, the decrease in the inverse participation
ratio, and the disappearance of the integrals of motion. As an application, we
use this geometry to solve a known problem of optimization of the set of
conserved quantities---regardless of whether it comes from symmetries or from
finite-size effects---to be incorporated in an extended thermodynamical theory
of integrable, near-integrable, or mesoscopic systems.
