First recorded in the Records of the Grand Historian (《史记·周本纪》) describing how the people "sang of [Hou Ji's] merit and praised his virtue" (民皆歌乐之,颂其德). Originally sincere; modern usage is almost always sarcastic.
register
Strongly negative connotation today — calling someone's writing or speech 歌功颂德 means it's slavish flattery, especially toward those in power. Stock phrase in political and literary criticism.