opentelemetry-collector-contrib icon indicating copy to clipboard operation
opentelemetry-collector-contrib copied to clipboard

[prometheusremotewriteexporter] don't add target info when it would only contain job and instance

Open dashpole opened this issue 3 years ago • 0 comments

Description:

The intention of the check for no resource attributes was to only produce the target_info metric when it provides meaningful additional attributes. However, we currently (without this change) will still emit the metric when target_info only has job and instance labels, which are already present on all other metrics. This change moves the check to after we filter out those attributes so we don't produce a useless metric.

Link to tracking Issue:

Addresses https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/12724#issuecomment-1197269139

Testing:

Added a unit test

cc @jmacd

dashpole avatar Jul 28 '22 14:07 dashpole