Component(s)
receiver/hostmetrics
Is your feature request related to a problem? Please describe.
The hostmetrics receiver emits resource attributes without service.instance.id or service.name. This prevents interoperability with Prometheus as OTel backend. For reference, per the Prometheus OpenTelemetry guide Prometheus treats service.instance.id and service.name as identifying resource attributes. The documentation states:
If a resource lacks both service.instance.id and service.name attributes, no corresponding target_info series is generated.
This means that when hostmetrics receiver metrics are sent to Prometheus via OTLP, all resource attributes are silently dropped — no target_info metric for encoding resource attributes is generated at all. The effect is that all resource context (hostname, OS info, etc.) is lost without warning.
The OTLP to Prometheus compatibility spec further mandates that service.instance.id MUST map to the Prometheus instance label and service.name to job. Without these, metrics from different hosts are indistinguishable — the instance label gets an empty value, collapsing all hosts into a single target.
The combined effect is:
- No
target_info metric generated: All resource attributes are lost
- No
instance label: Host metrics from different machines cannot be distinguished
- No host-to-process correlation: Cannot correlate host-level metrics with process-level metrics from the same machine
To work around the receiver not sending identifying resource attributes recognized by Prometheus, users currently have to add a resourcedetectionprocessor to the OTel Collector pipeline to emit these attributes.
Describe the solution you'd like
I propose adding a deterministic service.instance.id resource attribute to all scrapers in the hostmetrics receiver:
- For host-level scrapers (cpu, disk, filesystem, load, memory, network, nfs, paging, processes, system): a UUID v5 derived from the hostname using the OTel namespace UUID (
4d63009a-8d0f-11ee-aad7-4c796ed8e320), following the semantic conventions recommendation for deterministic ID generation
- For the process scraper: a unique UUID v5 per process, derived from the base hostname UUID combined with the process PID — ensuring each monitored process is a distinct Prometheus target
Describe alternatives you've considered
resourcedetectionprocessor — works but requires extra pipeline config, doesn't provide per-process uniqueness
- Random UUIDs — not deterministic, change on collector restart, would create new Prometheus time series on every restart
- Collector-level
service config — no per-process support for the process scraper
Additional context
Additional context
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Component(s)
receiver/hostmetrics
Is your feature request related to a problem? Please describe.
The hostmetrics receiver emits resource attributes without
service.instance.idorservice.name. This prevents interoperability with Prometheus as OTel backend. For reference, per the Prometheus OpenTelemetry guide Prometheus treatsservice.instance.idandservice.nameas identifying resource attributes. The documentation states:This means that when hostmetrics receiver metrics are sent to Prometheus via OTLP, all resource attributes are silently dropped — no
target_infometric for encoding resource attributes is generated at all. The effect is that all resource context (hostname, OS info, etc.) is lost without warning.The OTLP to Prometheus compatibility spec further mandates that
service.instance.idMUST map to the Prometheusinstancelabel andservice.nametojob. Without these, metrics from different hosts are indistinguishable — theinstancelabel gets an empty value, collapsing all hosts into a single target.The combined effect is:
target_infometric generated: All resource attributes are lostinstancelabel: Host metrics from different machines cannot be distinguishedTo work around the receiver not sending identifying resource attributes recognized by Prometheus, users currently have to add a
resourcedetectionprocessorto the OTel Collector pipeline to emit these attributes.Describe the solution you'd like
I propose adding a deterministic
service.instance.idresource attribute to all scrapers in the hostmetrics receiver:4d63009a-8d0f-11ee-aad7-4c796ed8e320), following the semantic conventions recommendation for deterministic ID generationDescribe alternatives you've considered
resourcedetectionprocessor— works but requires extra pipeline config, doesn't provide per-process uniquenessserviceconfig — no per-process support for the process scraperAdditional context
Additional context
service.instance.idgeneration using UUID v5.Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.