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,