I think the right way is to either add these values onto TaskContext, or reference a different object, such as a MetricsReporter of some kind. The latter is cleaner from a design point of view.