Li Du is a Chinese scholar, formerly a librarian in the imperial library. Now,in 1780, after a political scandal in which he was collateral damage, he's an exile wandering China. His wanderings have brought him to Dayan, a Chinese town on the Tibetan border, and he expects a quiet, provincial town.
Instead, he finds a town teaming with visitors, as the Emperor is about to arrive for a spectacular event: a total eclipse of the sun. He wants to be gone as quickly as possible, before the Emperor arrives, but an elderly Jesuit priest, an astronomer, dies suddenly, and Li finds evidence of murder. He's drawn in to investigating the death. He has three days.
Li quickly acquires friends and allies, starting with the wandering storyteller from Egypt. His suspects include the local magistrate himself, the magistrate's first consort, another Jesuit brother, and the ambassador of the powerful British East India Company.
This is both an excellent murder mystery, and a fascinating look at China in the late 18th century. a bonus extra is that wandering storyteller, who tells a story of Judge Dee (see Celebrated Cases of Judge Dee, and other titles by Robert van Gulik) that I had not encountered before.