Density of sampled exponential data, with sampling weights proportional to x itself Suppose $p(x) = \lambda e^{-\lambda x}$. However, our probability of observing a given sample of $x$ (denoted $z$) is further proportional to $x$ itself, i.e., $p(z\mid x) = \lambda e^{-\lambda x}$. What is $p(z)$?
In R, I can characterize the distribution empirically:
n = 1e5
r = 0.1
x = rexp(n,r)
z = sample(x,n,replace=TRUE,prob=x)
hist(z,100)

which seems to be gamma-distributed, with $\alpha = 2$ (shape) and $\beta = \lambda$ (rate). Is this right? How to derive $p(z)$ mathematically?
For context, $x$ is distributions of durations spent in an open population, and $z$ are the observed durations in this sample. TIA.

EDIT: The accepted answer (and comments below the question) highlight parts of my question which are posed incorrectly / badly described. I'll leave them unchanged here, but n.b. the answer states the question more correctly and precisely.
 A: Generally, suppose you are sampling a random variable $X$ from a distribution $F_X$ and the sampling intensity is proportional to some nonnegative function $h$ defined on the support of $X.$
Let $U$ be the random variable indicating whether $X$ is sampled, so that $\Pr(U=1\mid X=x)$ is proportional to $h(x).$  This specification of the conditional distribution (of $U$) along with the marginal distribution (of $X$) determines the joint distribution of $(X,U),$ so we should be able to figure out anything we want.  In particular, what is the distribution of $X$ conditional on $U=1,$ which is the observed value of $X$? By an elementary characterization of conditional probability,
$$\Pr(X \le z\mid U = 1) \ \propto\ \Pr(X \le z, U = 1)$$
(the constant of proportionality being just $1/\Pr(U=1),$ whose denominator we must assume is nonzero).  Furthermore
$$\Pr(X \le z, U = 1) = \int^z \Pr(U=1\mid X=x)\,\mathrm d F_X(x)\ \propto\ \int^z h(x)\,\mathrm d F_X(x).$$
This shows the distribution function for the observed values of $X$ must be
$$F_Z(z) = \frac{\int^z h(x)\,\mathrm d F_X(x)}{\int h(x)\,\mathrm d F_X(x)}.$$

That is, the probability measure for the observed version of $X$ is proportional to the probability measure for $X$ multiplied by the sampling intensity.

In your case, the support of $X$ is the positive numbers and, for positive numbers $x,$ $\mathrm dF_X(x) = 1 - e^{-\lambda x}$ and $h(x)$ is proportional to $x$ (not $e^{-\lambda x}$!).  Consequently
$$F_Z(z) \propto \int_0^z x\, e^{-\lambda x}\,\mathrm d x$$
and this is recognizable as a Gamma$(2,\lambda)$ distribution.  Its expectation is twice that of $X.$

Incidentally, if sampling were proportional to $e^{-\lambda x},$ the answer would be
$$F_Z(z) \propto \int_0^z e^{-\lambda x}\,e^{-\lambda x}\,\mathrm d x\ \propto\ 1 - e^{-2\lambda z}.$$
This is an exponential distribution with half the expectation of $X.$
