The chemical reactions and pathways involving icosanoids, any of a group of C20 polyunsaturated fatty acids.