ref: Avoid dropUndefinedKeys for spanToJSON calls
#15792
Merged
dropUndefinedKeys for spanToJSON calls
#15792