A general method for the design of diagnostics by means of Bayesian probability theory is outlined. Case studies are discussed for two diagnostics planned for Wendelstein 7-X (W7-X). First, line-of-sight optimization for interferometry meeting with physical optimization targets is investigated. The filter transmission bandwidth for Thomson scattering in W7-X is discussed as a second example.