telemetry: add utility functions for creating JSON