Reduce code duplication between job metrics and dependency resolution plugins.