  This article investigates the traces of certain modules over rings of
invariants associated with finite groups. More precisely, we provide a formula
for computing the traces of arbitrary semi-invariants, thereby contributing to
the understanding of the non-Gorenstein locus of rings of invariants.
Additionally, we discuss applications of this formula, including criteria for
rings of invariants to be Gorenstein on the punctured spectrum and nearly
Gorenstein, as well as criteria for semi-invariants to be locally free.
