diff --git a/component/otelcol/connector/host_info/host_metrics.go b/component/otelcol/connector/host_info/host_metrics.go index cdf2c6ddf23f..861702955e11 100644 --- a/component/otelcol/connector/host_info/host_metrics.go +++ b/component/otelcol/connector/host_info/host_metrics.go @@ -36,11 +36,11 @@ func (h *hostMetrics) metrics() (*pmetric.Metrics, int) { defer h.mutex.RUnlock() count := len(h.hosts) - var m *pmetric.Metrics + var pm *pmetric.Metrics if count > 0 { metrics := pmetric.NewMetrics() - m = &metrics + pm = &metrics ilm := metrics.ResourceMetrics().AppendEmpty().ScopeMetrics().AppendEmpty() ilm.Scope().SetName(typeStr) @@ -60,7 +60,7 @@ func (h *hostMetrics) metrics() (*pmetric.Metrics, int) { } } - return m, count + return pm, count } func (h *hostMetrics) reset() { diff --git a/docs/sources/flow/reference/components/otelcol.connector.host_info.md b/docs/sources/flow/reference/components/otelcol.connector.host_info.md index 4b1dc07f46f4..7533854c8400 100644 --- a/docs/sources/flow/reference/components/otelcol.connector.host_info.md +++ b/docs/sources/flow/reference/components/otelcol.connector.host_info.md @@ -34,6 +34,21 @@ otelcol.connector.host_info "LABEL" { | `host_identifiers` | `list(string)` | Ordered list of resource attributes used to identify unique hosts. | `["host.id"]` | no | | `metrics_flush_interval` | `duration` | How often to flush generated metrics. | `"60s"` | no | +## Blocks + +The following blocks are supported inside the definition of +`otelcol.connector.host_info`: + +| Hierarchy | Block | Description | Required | +| --------- | ---------- | ------------------------------------------------- | -------- | +| output | [output][] | Configures where to send received telemetry data. | yes | + +[output]: #output-block + +### output block + +{{< docs/shared lookup="flow/reference/components/output-block-metrics.md" source="agent" version="" >}} + ## Exported fields The following fields are exported and can be referenced by other components: