[backport] Minor improvement for make analyics more safe.