In the most recent otel collector upgrade, service_name is now a metric label. So is service.name resource attribute which is copied over into the metric labels by the metricresourceattrstoattrs processor. However, prometheus exporter sanitizes service.name into service_name resulting into 2 labels with the same name, hence it throws an error about duplicate label names. This is an issue that was previously fixed for service_instance_id.
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
[✅ ] Any dependent changes have been merged and published in downstream modules
Description
In the most recent otel collector upgrade,
service_name
is now a metric label. So isservice.name
resource attribute which is copied over into the metric labels by the metricresourceattrstoattrs processor. However, prometheus exporter sanitizesservice.name
intoservice_name
resulting into 2 labels with the same name, hence it throws an error about duplicate label names. This is an issue that was previously fixed forservice_instance_id
.Testing
Unit tests and local testing.
Checklist: