Lipid-rich diets are associated with impaired glucose metabolism and a reduced lifespan — this study shows that macrophages can contribute to both of these outcomes. Using Drosophila melanogaster as a model organism, Woodcock et al. found that a lipid-rich diet promoted the activation of macrophages and their expression of the type 1 cytokine Unpaired 3 (Upd3), which signals via the JAK–STAT pathway. Silencing of Upd3 expression in macrophages (but not in other cell types) increased fly longevity in response to a lipid-rich diet, and Upd3-deficient flies fed a control or lipid-rich diet had similar lifespans. Although wild-type D. melanogaster showed systemic JAK–STAT activation and developed hyperglycaemia in response to a lipid-rich diet, Upd3-deficient flies were protected against these effects. Macrophage depletion also protected flies on a lipid-rich diet from developing hyperglycaemia and increased their lifespan. A final series of experiments suggested that macrophage uptake of excess lipids via the scavenger receptor Croquemort may trigger a JNK-mediated stress response that leads to the production of Upd3.