Aims. Long gamma ray bursts (GRBs) are associated to the death of massive stars and have been discovered, so far, up to z = 6.29. Therefore, they hold the promise of probing star-formation and metal enrichment up to very high redshifts. However, the present GRB samples with redshift determinations are largely incomplete, and therefore a careful analysis of selection effects plaguing these samples is mandatory before any conclusion can be drawn from the observed GRB redshift distribution. Methods. To this purpose we study and compare three well-defined samples of long GRBs detected by Swift, HETE2, and BeppoSAX. Results. We find that Swift GRBs are, on average, slighly fainter and harder than BeppoSAX and HETE2 GRBs, as expected due to the higher energy range (15-150 keV) in which Swift GRBs are detected and localized, compared to BeppoSAX and HETE2 (≈2−20 keV). Gas and dust obscuration plays a role in shaping both the GRB samples and, most interestingly, the present samples of GRBs with redshift determination. In particular, we argue that the majority of the bright Swift GRBs without redshift might actually be z < ∼ 2 events and, therefore, that the present Swift GRB sample with redshift is biased against low-z GRBs. On the other hand, the detection of bright UV rest-frame afterglows from high-z GRBs, and even from those with large X-ray obscuration, implies a lower dust amount than in nearby GRBs and/or a different dust composition. If this is the case, the Swift sample of GRBs with redshifts is probably a fair sample of the real high-z GRB population. The absence of high-z GRBs in the BeppoSAX and HETE2 samples of GRBs with redshifts is probably due to how, at the time of BeppoSAX and HETE2 follow-up, faint afterglows of high-redshift GRBs will have weakened below the spectroscopic capabilities of even 10m-class telescopes. The redshift distribution of a subsample of Swift GRBs with distributions of peak fluxes, X-ray obscuration and optical magnitude at a fixed observing time similar to those of the BeppoSAX and HETE2 samples, is roughly consistent with the real BeppoSAX+HETE2 redshift distribution.