Add support for metrics plugins Upstream-commit: 680084b2a2eb1ac1ced2dd4c695fdc469c25dc7f Component: engine