How did the constant $\pi$ creep into Einstein's field equation? 
*

*The ratio of a circle to its diameter in Euclidean space appears in places that sometimes appear to be mysterious.  I am wondering if in Einstein's field equations he is using Poisson's formulation of Newtonian gravity and it has somehow worked its way into Einstein's equation and if so then how did Poisson end up adding pi in his equation? 

*Here I go again trying to do history. Since $\pi$ describes the ratio of the circumference to the diameter in Euclidean space why is it used in an equation that describes how space is stretched and squeezed in General Relativity? 

*After all it may be that depending on the mass, space is being stretched or squeezed in a non Euclidean fashion. Would that not change the ratio? 
 A: We have Newton's law in the form 
$$ F = \frac{Gm_1m_2}{r^2}$$
which is the same as the field equation for the potential $$ \nabla^2 \phi = 4\pi G \rho $$
where $\rho$ is the mass density. The $4\pi$ here does indeed come from the solid angle of an entire sphere, but by redefining $G$ we could put it in Newton's law instead. 
This is connected to GR by noting that under appropriate assumptions, i.e., in the Newtonian limit, the $00$ component of the metric corresponds to the Newtonian potential $\phi$. Writing out the Einstein field equations $$R_{\mu\nu} -\frac{1}{2} \,R\,g_{\mu\nu}= \kappa T_{\mu\nu}$$ under the same assumptions, to match the Newtonian field equation we must have $\kappa = 8\pi G/c^4$. (Another answer gives an outline of the argument.) But again we could redefine $G$ to absorb $4\pi$ or $8\pi$. But then $\pi$ would show up again in for example the relation between mass and Schwarzschild radius. And indeed many GR texts decide to use units where $\kappa =1$. 
There is an analogous situation in electrodynamics where depending on units you may encounter the source of Poisson's equation with a factor $\epsilon_0, \frac{\epsilon_0}{4\pi}$ or $1$. And again this just shifts the constant into other equations and quantities, e.g., Coulomb's law or the expression for the plasma frequency. 
A: In initially writing the Einstein-Hilbert action on a spacetime M:
$$S=\intop_{M}(kR+l_{m})\sqrt{-g}d^{4}x$$
Where $R$ is the Ricci scalar, and $l_{m}$
  is the matter lagrangian, we have k as an unknown (constant) quantity. Taking the variation of the action, with respect to $g^{\mu\nu}$
  and dropping the integral, one obtains:
$$k(R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R)=T_{\mu\nu}$$
assuming a weakfield and flat background spacetime (for simplicity, it's not required), one can do a first order approximation to this by expanding about the background metric:
$$g_{\mu\nu\:total}=g_{\mu\nu\:background}+h_{\mu\nu}$$
Where, considering only scalar pertubations (neglecting vector and tensor perturbations will be justified when we make the static approximation):
$$h_{\mu\nu}=g_{\mu\nu}2\phi$$
Skipping many steps and changing variables to the trace reversed perturbation $\bar{h}_{\mu\nu}=h_{\mu\nu}-\frac{1}{2}g_{\mu\nu}h$
  and choosing the Lorentz gauge $\bar{h}_{\mu\nu}^{\;,\nu}=0$
 , one obtains:
$$k\square(\bar{h}_{\mu\nu})-T_{\mu\nu}=0$$
In the rest frame of a massive body with density $\rho$
 , we have that all time derivatives are zero and $T_{\mu\nu}=T_{\mu\nu}\delta_{\mu}^{0}\delta_{\nu}^{0}=\rho c^{2}$
 , which leaves us with:
$$k\nabla^{2}2\phi=\rho c^{2}$$
Which must match Newtonian gravity in the Poisson formulation, which is:
$$\nabla^2\phi=4\pi G_{N}\rho$$
  Thus:
$$k=\frac{c^{2}}{8\pi G_{N}}$$
In other words, when properly approximated, General relativity must correspond
  to Newtonian gravity. I just wrote this out of my head so don't be surprised if there are mistakes, but you get the idea. also, there are many ways to show general relativity reduces to Newtonian gravity, this is just one path. Hope this helps
A: Pi crops up in mathematics and physics in all sorts of places that have absolutely nothing to do with circles and basic geometry, such as $e^{i\pi}=-1$, which is purely a statement about numbers. Don't think of it as the ratio of the circumference of a circle to its diameter.  Think of it as a fundamentally important mathematical constant,  and one of its uses its in finding out the diameter of a circle. Another one happens to be in general relativity (and it also crops up in electrostatics, magnetism, error estimation and hundreds of other places).
