Prosecutorial discretion is an expansive term that covers all decisions regarding the nature and extent of the prosecution and the Attorney General’s participation in it.

R. v. Anderson, 2014 SCC 41 (CanLII), at para. 44.
It includes, among many other things, the Crown’s decision to negotiate a plea agreement [FN], as well the Crown’s election.
            See Stuart O’Connell Law Blog, Crown Election
Judicial non-interference with prosecutorial discretion has been referred to as a matter of principle based on the doctrine of separation of powers as well as a matter of policy founded on the efficiency of the system of criminal justice which also recognizes that prosecutorial discretion is especially ill-suited to judicial review.
See R. v. Anderson, 2014 SCC 41 (CanLII), at para. 23.

Prosecutorial discretion is reviewable solely for abuse of process. 
Anderson, at para. 51.

The Exercise of Prosecutorial Discretion as an Abuse of Process
To succeed on an application for abuse of process, the accused is obliged to demonstrate Crown conduct that was “egregious and seriously compromise[d] trial fairness and/or the integrity of the justice system”. 
            Anderson, at para. 50.  

Only if an accused meets the threshold evidentiary burden of establishing a proper evidentiary foundation for his/her abuse of process will the court inquire into the reasons behind the exercise of prosecutorial discretion.
            R. v. Delchev, 2015 ONCA 381, at para. 49; 

            R. v. St. Amand, 2017 ONCA 913, at para. 31 (for a recent application of this principle).

[FN] R. v. Anthony-Cook, 2016 SCC 43 (CanLII), at para. 34 sets out a particular legal test as to when a court may depart from a joint submission by on sentence (that is, the sentence is “…so unhinged from the circumstances…” that it would lead a reasonable person to believe that the proper functioning of the justice system had broken down.  In my opinion, this test is a context-specific elaboration of the abuse of process doctrine.