Duplicate Prometheus metrics

When I set up the Prometheus http_sd_configs i get the Prometheus PrometheusDuplicateTimestamps alert. When i request the metrics manually, i can see that the same metrics with the same value are reported multiple times.

Since v2.52.0 if on a scrape duplicate metrics are found the prometheus_target_scrapes_sample_duplicate_timestamp_total is increased, making the alert get triggered.

Is there any way to overcome this issue ?