Sync some patchs from upstreaming for telemetry and modifies
are as follow:
1. Support dispaly integer as hexadecimal.
2. Fix data truncation for some u64 accept as int.
3. Add JSON pretty print.
(cherry picked from commit 9e45664c52b35caa057da6a442599e03f4527817)