Metsuke

 were the censors or the inspectors of Tokugawa shogunate. They were "bakufu" officials ranking somewhat lower than the "bugyō." The "metsuke" were charged with the special duty of detecting and investigating instances of maladministration, corruption or disaffection anywhere in Japan; and particularly amongst the populace having status below the "daimyō".
Intelligence gathering.
The shogunate recognized the need for some kind of internal intelligence-gathering apparatus and for some degree of covert espionage within its own ranks. It could be said that the "metsuke" functioned as the Shogun's intelligence agency or as internal spies, reporting to the officials in Edo on events and situations across the country.
The "metsuke" were charged with focusing on those ranking below "daimyō"-status; and their counterparts, the "ōmetsuke", were responsible for supervising the activities of officials and members of the "daimyō" (feudal lords).
Although similarly engaged, the reporting protocols of the "metsuke" and "ōmetsuke" differed. The "metsuke" reported to "wakadoshiyori" who ranked just below the "rōjū". The "ōmetsuke" reported directly to the four or five "rōjū" at the top of the shogunate bureaucracy. By design, the intelligence-gathering activities of the "metsuke" was intended to complement those of the "ōmetsuke" even though there was no official reporting relationship between the two somewhat independent groups.
There were at any given time as many as twenty-four "metsuke".
Ad hoc evolution.
The bureaucracy of the Tokugawa shogunate expanded on an "ad hoc" basis, responding to perceived needs and changing circumstances. Sometimes one or more of the "metsuke" or "ōmetsuke" would have been selected to address a specific or even a unique problem. For example, Arao Norimasa in the period from 1852 through 1854 was charged with special duties as "kaibo-gakari-metsuke".
The prefix "kaibō-gakari" meaning "in charge of maritime defense" was used with the titles of some "bakufu" officials after 1845. This term was used to designate those who bore a special responsibility for overseeing coastal waters, and by implication, for dealing with matters involving foreigners. "Kaibō-gakari-metsuke" later came to be superseded by the term "gaikoku-gakari." These developments preceded the "Gaikoku bugyō" system which began just prior to the negotiations which resulted in the Harris Treaty. First appointed in August 1858, the "gaikoku-bugyō" were bakufu officials who were charged with advising the government on foreign affairs and who were tasked with conducting negotiations with foreign diplomats both in Japan and abroad.
In popular culture.
The post of "metsuke" was, of course, not immune to corruption; and sometimes the conduct of these officials could be affected by bribes. For example, the televised "jidaigeki" episodes of "Abarenbō Shōgun" are rife with petty corruption, including a broad range of officials across the span of television seasons.
"Metsuke" also appear as persecutors of Japanese Christians in the film "Silence" (2016).
Metsuke are also portrayed by the game "" as agents who try and imprison members of an enemy clan,
as well as looking over settlements if needed.