Embodiments of the invention distribute profiling responsibilities for a
clustered application to various instances of the application that
generally run on different computer hosts. In an embodiment, the
profiling responsibility is measured in terms of metrics wherein each
profiling agent of an instance collects metrics about that instance. The
metrics are prioritized and assigned to instances such that the highest
priority metrics are assigned if possible. Each metric is associated with
an expected performance overhead, and the assignment of metrics to an
instance is done such that the performance overhead on that instance
and/or host does not exceed a threshold. Other embodiments are also
disclosed.