The Nexus 6P is one of those phones that had high initial quality, but it hasn't withstood the test of time very well. This phone has been plagued by battery issues that cause it to randomly shut off. Those who bought their phones from the Google Store have reported success not only with getting the phone replaced, but replaced with a Pixel XL.
There have been sporadic reports for months of 6P owners getting Pixels back from Google, but now it seems like a near certainty in some places. People swapping out a defective Nexus 6P in the US and Canada apparently have a very high chance of getting a Pixel. Some in the UK are still receiving refurbished Nexus 6Ps, and it sounds like everyone in Australia is still getting a 6P back. The exact nature of the upgrade seems to vary as well. Some are being offered 32GB Pixel XLs, while others get the 128GB variant. The upgraded 64GB 6P seems to afford a higher chance of the larger capacity.
Google is doing this for defective phones, even outside of the original 1-year warranty. Just head to the support menu on your phone or the website to get in touch. Remember, this is only for phones bought from the Google Store. Replacement devices will be sent out as an "advance exchange," so you get it before mailing the old phone back. Google will do a pre-authorization on your credit card in the amount of the replacement phone. Make sure you send the old one back to avoid being charged.