Make custom dimensions & metrics thread-safe.