You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/collector/opentelemetry-collector-infra-hosts.mdx
+68-128
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,8 @@ tags:
7
7
metaDescription: The OpenTelemetry Collector is a central tool to collect, process, and export your telemetry.
8
8
---
9
9
10
-
You can collect metrics about your infrastructure hosts with OpenTelemetry if you set up the host receiver in a collector. The collector is a component of OpenTelemetry that collects, processes, and exports telemetry data to New Relic (or any observability backend).
10
+
You can collect metrics and logs from your infrastructure hosts with OpenTelemetry and leverage the same infrastructure experiences that are available for New Relic agents.
11
+
Specific receivers and processors are required in the OTel collector to collect and report host telemetry.
11
12
12
13
If you're looking for help with other collector use cases, see the [newrelic-opentelemetry-examples](https://github.com/newrelic/newrelic-opentelemetry-examples) repository.
13
14
@@ -33,11 +34,13 @@ Your deployment experience might vary depending on which vendor-specific distrib
33
34
To set up infrastructure monitoring, you need to install and configure components that are included in the `collector-contrib` release. For example, the host receiver is required to collect basic host metrics such as CPU, memory, disk, and network stats and is only available in the [OpenTelemetry Collector-contrib](https://github.com/open-telemetry/opentelemetry-collector-contrib) release.
34
35
</Callout>
35
36
36
-
## Step 3: Configure host monitoring using the host receiver[#host-receiver]
37
+
## Step 3: Configure host metrics and logs[#host-receiver]
37
38
38
39
This collector example is meant to serve as a starting point from which you can extend, customize, and validate configurations before using them in production.
39
40
40
-
The `collector-contrib` release provides a `hostreceiver` that generates metrics about the system scraped from various sources. Deploy the collector as an agent when you use a `hostreceiver`.
41
+
The `collector-contrib` release includes:
42
+
* The `hostreceiver` that generates metrics about the system scraped from various sources. Deploy the collector as an agent when you use a `hostreceiver`.
43
+
* The `filelogreceiver` that tails and parses logs from files.
41
44
42
45
When using the host receiver as part of the collector configuration, New Relic automatically detects host metrics as part of a `Host` entity and will synthesize its golden metrics providing the same experience as with the New Relic infrastructure agent. The following are the configuration requirements to enable the `Host` entity experience in New Relic UI:
43
46
@@ -46,113 +49,12 @@ When using the host receiver as part of the collector configuration, New Relic a
46
49
47
50
Learn more about available metrics and advanced configurations from the [OpenTelemetry documentation in GitHub](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/hostmetricsreceiver).
48
51
49
-
Adapt the `config.yaml` with these recommended parameters:
52
+
Here is a sample configuration YAML file for a linux host. Be sure to do the following:
50
53
51
-
<Calloutvariant="important">
52
-
CPU, load, memory, and disk utilization metrics require otelcol-contrib release `v0.47.0` or greater.
53
-
</Callout>
54
-
55
-
<table>
56
-
<thead>
57
-
<tr>
58
-
<thstyle={{ width: "290px" }}>
59
-
Configuration
60
-
</th>
61
-
62
-
<th>
63
-
Description
64
-
</th>
65
-
</tr>
66
-
</thead>
67
-
68
-
<tbody>
69
-
<tr>
70
-
<td>
71
-
`receivers::hostmetrics`
72
-
</td>
73
-
74
-
<td>
75
-
Enable host metrics.
76
-
77
-
* A 20 second interval is recommended (same default as the Infrastructure agent).
78
-
* It should not be greater than 60 seconds to avoid issues with “host not responding” alerts.
79
-
* Process instrumentation is optional.
80
-
</td>
81
-
</tr>
82
-
83
-
<tr>
84
-
<td>
85
-
`processors::resourcedetection`
86
-
</td>
87
-
88
-
<td>
89
-
Keep the following in mind:
90
-
91
-
*`env`: Reads resource information from the `OTEL_RESOURCE_ATTRIBUTES` environment variable.
92
-
* `system`: Adds `host.name` and `os.type`.
93
-
* For cloud environments, configure a specific resource detection processor so that metrics are decorated with `host.id` (required to identify the host entity in New Relic). Common cloud detectors are `gce` for GCP machines, `ec2` for AWS EC2, and `azure` for Azure VMs. Additional processors are available for orchestrated environments.
94
-
* For on-premises systems (or unsupported cloud environments), a `host.id` attribute is required. Use the `resource` processor to copy the `host.name` value (from `system`) as a new `host.id` attribute. Note this value should be unique across all instrumented hosts:
95
-
```yaml
96
-
resource:
97
-
attributes:
98
-
- key: host.id
99
-
from_attribute: host.name
100
-
action: upsert
101
-
```
102
-
</td>
103
-
</tr>
104
-
105
-
<tr>
106
-
<td>
107
-
`processors::batch`
108
-
</td>
109
-
110
-
<td>
111
-
The [batch processor](https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/batchprocessor/README.md) accepts spans, metrics, or logs and places them into batches. Batching helps better compress the data and reduce the number of outgoing connections required to transmit the data. This processor supports both size and time based batching.
112
-
</td>
113
-
</tr>
114
-
115
-
<tr>
116
-
<td>
117
-
`processors::memory_limiter`
118
-
</td>
119
-
120
-
<td>
121
-
The [memory limiter](https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/memorylimiterprocessor) processor is used to prevent out of memory situations on the collector.
122
-
123
-
Putting checks in place is important because:
124
-
125
-
* The amount and type of data the collector processes is specific to its environment.
126
-
* The collector's resource utilization is dependent on the configured processors.
127
-
</td>
128
-
</tr>
129
-
130
-
<tr>
131
-
<td>
132
-
`processors::cumulative_delta`
133
-
</td>
134
-
135
-
<td>
136
-
The [cumulative delta](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/cumulativetodeltaprocessor) processor converts cumulative sum metrics to cumulative delta. This helps you query system metric rates more easily in New Relic.
137
-
</td>
138
-
</tr>
139
-
140
-
<tr>
141
-
<td>
142
-
`service::pipelines::metrics`
143
-
</td>
144
-
145
-
<td>
146
-
Make sure `hostreceiver` and `resourcedetection` are included.
147
-
</td>
148
-
</tr>
149
-
</tbody>
150
-
</table>
151
-
152
-
Here is a sample configuration YAML file. Be sure to do the following:
153
-
154
-
* Replace OTLP_ENDPOINT_HERE with the appropriate [endpoint](/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/get-started/opentelemetry-set-up-your-app/#review-settings).
155
-
* Replace YOUR_KEY_HERE with your <InlinePopovertype="licenseKey" />
54
+
* Replace `OTLP_ENDPOINT_HERE` with the appropriate [endpoint](/docs/more-integrations/open-source-telemetry-integrations/opentelemetry/get-started/opentelemetry-set-up-your-app/#review-settings).
55
+
* Replace `YOUR_KEY_HERE` with your <InlinePopovertype="licenseKey" />.
56
+
* Adjust the target log files in the filelog receiver section based on your requirements.
57
+
* Adjust the `memory_limiter` default values based on your environment requirements.
@@ -229,11 +164,11 @@ You can view your collector data in a variety of places in the New Relic UI.
229
164
230
165
### Browse host data in infrastructure UI [#using-ui]
231
166
232
-
By using the recommended configuration for the host receiver, you can view data through the standard features in the [Infrastructure UI](/docs/infrastructure/infrastructure-ui-pages/infrastructure-ui-entities#access-new-ui) (New Host UI) experience.
167
+
By using the recommended configuration in the collector, you can view data through the standard features in the [Infrastructure UI](/docs/infrastructure/infrastructure-ui-pages/infrastructure-ui-entities#access-new-ui) experience.
233
168
234
-
### Query host metrics [#query-host-metrics]
169
+
### Query host metrics and logs [#query-host-metrics]
235
170
236
-
Once metrics are successfully ingested in New Relic, they are available in [metrics and events](/docs/query-your-data/explore-query-data/browse-data/introduction-data-explorer) and [query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder).
171
+
Once telemetry is successfully ingested in New Relic, they are available in [metrics and events](/docs/query-your-data/explore-query-data/browse-data/introduction-data-explorer) and [query builder](/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder).
237
172
238
173
The following NRQL queries show examples to help you explore the metrics you received:
239
174
@@ -255,6 +190,11 @@ The following NRQL queries show examples to help you explore the metrics you rec
255
190
SELECT keyset() FROM Metric WHERE metricName ='system.disk.operations'
256
191
```
257
192
193
+
* Querying number of log events per host
194
+
```sql
195
+
SELECTcount(*) FROM Log FACET host.name TIMESERIES
196
+
```
197
+
258
198
Learn more about [querying the metric data type](/docs/data-apis/understand-data/metric-data/query-metric-data-type).
0 commit comments