The present invention provides a surface-treating agent which improves heat resistance, adhesiveness to resin and solder wettability. The surface-treating agent for metal contains a tetrazole derivative represented by the following formula and / or a salt thereof,wherein R1 and R2 each independently represent a hydrogen atom, a halogen atom, or an alkyl group or an aryl group, etc., which each have a carbon number of not more than 10, and a group having a halogen atom, a hydroxyl group, a carboxyl group, an amino group or a mercapto group added thereto, or represent an amino group, a mercapto group, a hydroxyl group or a carboxyl group; and R3 represents a bond or an alkylene group, etc., which each have a carbon number of not more than 10, and a group having a halogen atom, a hydroxyl group, a carboxyl group, an amino group, a mercapto group, an azo group (—N═N—), a sulfide group (—S—), or a disulfide group (—S—S—) added thereto, or represents an azo group, a sulfide group, or disulfide group, and may contain a metal or metal compound.