How to derive the measurement equation for the state-space representation of a DSGE model? DSGE models, after log-linearisation, have a state-space representation. 
In this representation, in most papers, the measurement/observation equation is simply stated.

I'm wondering how one deduces that equation, or if it's something ad-hoc, how does one proceed, or what guidlines should we use?

Any help would be appreciated.
Hi: I can't speak for DSGE models specifically but, in more standard "rational expectations" econometrics, the measurement equation usually comes from some assumed linear relation between the dependent variable and the expectation of some other variable. For example, one might have

$y_t = \beta x^{*}_{t} + \epsilon_{t}$ 

where  $x^{*}_{t}$ is the expectation of $x$ at time t so $E(x_t|t-1)$. Note that $x_t$  is often not observable so some formulation for how the expectation is generated must be assumed.  So, for example, if one assumes the adaptive expectations hypothesis for the expectation, then this implies the following relation for $x^{*}_t$:

$x^{*}_t = x^{*}_{t-1} + \gamma(x_{t-1} - x^{*}_{t-1})$

Putting the two relations together, one ends up with an exponential smoothing relation for $y_t$ which would then be the measurement equation:

$y_t = \beta \times \gamma \sum_{j=0}^{\infty} (1-\gamma)^{j} x_{t-j-1} + \epsilon_t$

Almost all of above is taken from Harvey's "Econometric Analysis of Time Series" which I highly recommend not for DSGE models but for RE type econometrics. I assume that something similar is done in DSGE models but I'm not absolutely sure because I have no experience with them. Still, this may help some.