Skip to content

Commit

Permalink
update docs for otelcol.connector.host_info (#6488)
Browse files Browse the repository at this point in the history
Signed-off-by: Robbie Lankford <[email protected]>
  • Loading branch information
rlankfo authored Feb 22, 2024
1 parent c58709a commit 9868233
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions component/otelcol/connector/host_info/host_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -60,7 +60,7 @@ func (h *hostMetrics) metrics() (*pmetric.Metrics, int) {
}
}

return m, count
return pm, count
}

func (h *hostMetrics) reset() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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="<AGENT_VERSION>" >}}

## Exported fields

The following fields are exported and can be referenced by other components:
Expand Down

0 comments on commit 9868233

Please sign in to comment.