[exporter] prometheusremotewrite appends _None to Datapoints with "Unit: None" #22828
Closed
Description
Component(s)
exporter/prometheusremotewrite
What happened?
Description
It seems that datapoints where the Unit has not been assigned (Unit: None
) end up having _None
appended to the end of the metric name.
Steps to Reproduce
- Send metrics to a receiver without specifying a Unit Type (the ecscontainermetrics receiver doesn't set Unit for some CPU Metrics, as shown in the screenshot below)
- Use the prometheusremotewrite exporter, which will append
_None
to the metrics.
Expected Result
_None
not being appended to Metrics
Actual Result
_None
is being appended to Metrics
Collector version
0.77.0
Environment information
Environment
Linux - Alpine
OpenTelemetry Collector configuration
receivers:
awsecscontainermetrics:
collection_interval: 20s
exporters:
logging:
verbosity: detailed
sampling_initial: 5
sampling_thereafter: 200
prometheusremotewrite:
endpoint: "http://prometheus/api/v1/push"
tls:
insecure: true
cert_file: file.cert
key_file: file.key
resource_to_telemetry_conversion:
enabled: true
target_info:
enabled: false
export_created_metric:
enabled: false
processors:
memory_limiter:
check_interval: 1s
limit_percentage: 80
spike_limit_percentage: 20
batch:
send_batch_size: 8192
timeout: 200ms
send_batch_max_size: 0
service:
pipelines:
metrics:
receivers: [awsecscontainermetrics]
processors: [memory_limiter,batch]
exporters: [prometheusremotewrite,logging]
Log output
Descriptor:
-> Name: container.cpu.utilized
-> Description:
-> Unit: None
-> DataType: Gauge
...
Descriptor:
-> Name: container.cpu.reserved
-> Description:
-> Unit: None
-> DataType: Gauge
### Additional context
Metrics showing in Mimir:
![image](https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/31159882/95d657e3-5739-4570-ae55-fa1d0ee530ed)