4. Given that $a$ is an integer, the equation concerning $x$
$$
\frac{x^{2}}{x^{2}+1}-\frac{4|x|}{\sqrt{x^{2}+1}}+2-a=0
$$

has real roots. Then the possible values of $a$ are
$$
4.0,1,2 \text {. }
$$

Let $y=\frac{|x|}{\sqrt{x^{2}+1}}$. Then $0 \leqslant y<1$. From
$$
\begin{array}{l}
y^{2}-4 y+2-a=0 \Rightarrow(y-2)^{2}=2+a \\
\Rightarrow 1<2+a \leqslant 4 \Rightarrow-1<a \leqslant 2 .
\end{array}
$$

Therefore, the possible values of $a$ are $0, 1, 2$.