TS-1475 Add checks for getting metrics / configs for ts_lua.
from 1e57adad9a67c78be1f33fd5ed8c5679c6811ea2 @master