pyroscope
pyroscope copied to clipboard
Fix: Handle duplicate validation correctly when sanitizing
When replacing dots with underscores, we don't take care of the order of the labels slice, hence our duplicate check can be ineffective.
This change will fix this bug and also will handle the case when both the sanitized and unsanitized label values actually match and reduce them to the sanitized variant.
Discovered when reviewing #4236