Do not copy service.instance.id resource attr if service_instance_id already exists in the metric attrs. This is because the prometheus exporter will sanitize service.instance.id to become service_instance_id and hence there will be duplicate attributes and that will cause an error when scraping the prometheus metrics. This started happening after upgrading to otel collector v0.49.0
Testing
Unit tests and local testing.
Checklist:
[ ✅ ] My changes generate no new warnings
[✅ ] I have added tests that prove my fix is effective or that my feature works
Description
Do not copy service.instance.id resource attr if service_instance_id already exists in the metric attrs. This is because the prometheus exporter will sanitize service.instance.id to become service_instance_id and hence there will be duplicate attributes and that will cause an error when scraping the prometheus metrics. This started happening after upgrading to otel collector v0.49.0
Testing
Unit tests and local testing.
Checklist: