|
| 1 | +extensions: |
| 2 | + health_check: |
| 3 | + |
1 | 4 | receivers: |
2 | 5 | otlp: |
3 | 6 | protocols: |
4 | 7 | grpc: |
5 | 8 | http: |
6 | 9 |
|
| 10 | + hostmetrics: |
| 11 | + # Default collection interval is 60s. Lower if you need finer granularity. |
| 12 | + collection_interval: 60s |
| 13 | + scrapers: |
| 14 | + cpu: |
| 15 | + metrics: |
| 16 | + system.cpu.time: |
| 17 | + enabled: false |
| 18 | + system.cpu.utilization: |
| 19 | + enabled: true |
| 20 | + load: |
| 21 | + memory: |
| 22 | + metrics: |
| 23 | + system.memory.utilization: |
| 24 | + enabled: true |
| 25 | + paging: |
| 26 | + metrics: |
| 27 | + system.paging.utilization: |
| 28 | + enabled: false |
| 29 | + system.paging.faults: |
| 30 | + enabled: false |
| 31 | + filesystem: |
| 32 | + metrics: |
| 33 | + system.filesystem.utilization: |
| 34 | + enabled: true |
| 35 | + disk: |
| 36 | + metrics: |
| 37 | + system.disk.merged: |
| 38 | + enabled: false |
| 39 | + system.disk.pending_operations: |
| 40 | + enabled: false |
| 41 | + system.disk.weighted_io_time: |
| 42 | + enabled: false |
| 43 | + network: |
| 44 | + metrics: |
| 45 | + system.network.connections: |
| 46 | + enabled: false |
| 47 | + # Uncomment to enable process metrics, which can be noisy but valuable. |
| 48 | + # processes: |
| 49 | + # process: |
| 50 | + # metrics: |
| 51 | + # process.cpu.utilization: |
| 52 | + # enabled: true |
| 53 | + # process.cpu.time: |
| 54 | + # enabled: false |
| 55 | + |
| 56 | + filelog: |
| 57 | + include: |
| 58 | + - /var/log/alternatives.log |
| 59 | + - /var/log/cloud-init.log |
| 60 | + - /var/log/auth.log |
| 61 | + - /var/log/dpkg.log |
| 62 | + - /var/log/syslog |
| 63 | + - /var/log/messages |
| 64 | + - /var/log/secure |
| 65 | + - /var/log/yum.log |
| 66 | + |
7 | 67 | processors: |
| 68 | + # group system.cpu metrics by cpu |
| 69 | + metricstransform: |
| 70 | + transforms: |
| 71 | + - include: system.cpu.utilization |
| 72 | + action: update |
| 73 | + operations: |
| 74 | + - action: aggregate_labels |
| 75 | + label_set: [ state ] |
| 76 | + aggregation_type: mean |
| 77 | + - include: system.paging.operations |
| 78 | + action: update |
| 79 | + operations: |
| 80 | + - action: aggregate_labels |
| 81 | + label_set: [ direction ] |
| 82 | + aggregation_type: sum |
| 83 | + # remove system.cpu metrics for states |
| 84 | + filter/exclude_cpu_utilization: |
| 85 | + metrics: |
| 86 | + datapoint: |
| 87 | + - 'metric.name == "system.cpu.utilization" and attributes["state"] == "interrupt"' |
| 88 | + - 'metric.name == "system.cpu.utilization" and attributes["state"] == "nice"' |
| 89 | + - 'metric.name == "system.cpu.utilization" and attributes["state"] == "softirq"' |
| 90 | + filter/exclude_memory_utilization: |
| 91 | + metrics: |
| 92 | + datapoint: |
| 93 | + - 'metric.name == "system.memory.utilization" and attributes["state"] == "slab_unreclaimable"' |
| 94 | + - 'metric.name == "system.memory.utilization" and attributes["state"] == "inactive"' |
| 95 | + - 'metric.name == "system.memory.utilization" and attributes["state"] == "cached"' |
| 96 | + - 'metric.name == "system.memory.utilization" and attributes["state"] == "buffered"' |
| 97 | + - 'metric.name == "system.memory.utilization" and attributes["state"] == "slab_reclaimable"' |
| 98 | + filter/exclude_memory_usage: |
| 99 | + metrics: |
| 100 | + datapoint: |
| 101 | + - 'metric.name == "system.memory.usage" and attributes["state"] == "slab_unreclaimable"' |
| 102 | + - 'metric.name == "system.memory.usage" and attributes["state"] == "inactive"' |
| 103 | + filter/exclude_filesystem_utilization: |
| 104 | + metrics: |
| 105 | + datapoint: |
| 106 | + - 'metric.name == "system.filesystem.utilization" and attributes["type"] == "squashfs"' |
| 107 | + filter/exclude_filesystem_usage: |
| 108 | + metrics: |
| 109 | + datapoint: |
| 110 | + - 'metric.name == "system.filesystem.usage" and attributes["type"] == "squashfs"' |
| 111 | + - 'metric.name == "system.filesystem.usage" and attributes["state"] == "reserved"' |
| 112 | + filter/exclude_filesystem_inodes_usage: |
| 113 | + metrics: |
| 114 | + datapoint: |
| 115 | + - 'metric.name == "system.filesystem.inodes.usage" and attributes["type"] == "squashfs"' |
| 116 | + - 'metric.name == "system.filesystem.inodes.usage" and attributes["state"] == "reserved"' |
| 117 | + filter/exclude_system_disk: |
| 118 | + metrics: |
| 119 | + datapoint: |
| 120 | + - 'metric.name == "system.disk.operations" and IsMatch(attributes["device"], "^loop.*") == true' |
| 121 | + - 'metric.name == "system.disk.merged" and IsMatch(attributes["device"], "^loop.*") == true' |
| 122 | + - 'metric.name == "system.disk.io" and IsMatch(attributes["device"], "^loop.*") == true' |
| 123 | + - 'metric.name == "system.disk.io_time" and IsMatch(attributes["device"], "^loop.*") == true' |
| 124 | + - 'metric.name == "system.disk.operation_time" and IsMatch(attributes["device"], "^loop.*") == true' |
| 125 | + filter/exclude_system_paging: |
| 126 | + metrics: |
| 127 | + datapoint: |
| 128 | + - 'metric.name == "system.paging.usage" and attributes["state"] == "cached"' |
| 129 | + - 'metric.name == "system.paging.operations" and attributes["type"] == "cached"' |
| 130 | + filter/exclude_network: |
| 131 | + metrics: |
| 132 | + datapoint: |
| 133 | + - 'IsMatch(metric.name, "^system.network.*") == true and attributes["device"] == "lo"' |
| 134 | + |
| 135 | + attributes/exclude_system_paging: |
| 136 | + include: |
| 137 | + match_type: strict |
| 138 | + metric_names: |
| 139 | + - system.paging.operations |
| 140 | + actions: |
| 141 | + - key: type |
| 142 | + action: delete |
| 143 | + |
| 144 | + cumulativetodelta: |
| 145 | + |
| 146 | + transform/host: |
| 147 | + metric_statements: |
| 148 | + - context: metric |
| 149 | + statements: |
| 150 | + - set(description, "") |
| 151 | + - set(unit, "") |
| 152 | + |
| 153 | + transform: |
| 154 | + trace_statements: |
| 155 | + - context: span |
| 156 | + statements: |
| 157 | + - truncate_all(attributes, 4095) |
| 158 | + - truncate_all(resource.attributes, 4095) |
| 159 | + log_statements: |
| 160 | + - context: log |
| 161 | + statements: |
| 162 | + - truncate_all(attributes, 4095) |
| 163 | + - truncate_all(resource.attributes, 4095) |
| 164 | + |
8 | 165 | # used to prevent out of memory situations on the collector |
9 | 166 | memory_limiter: |
10 | 167 | check_interval: 1s |
11 | 168 | limit_mib: ${env:NEW_RELIC_MEMORY_LIMIT_MIB:-100} |
| 169 | + |
12 | 170 | batch: |
13 | 171 |
|
| 172 | + resourcedetection: |
| 173 | + detectors: ["system"] |
| 174 | + system: |
| 175 | + hostname_sources: ["os"] |
| 176 | + resource_attributes: |
| 177 | + host.id: |
| 178 | + enabled: true |
| 179 | + |
| 180 | + resourcedetection/cloud: |
| 181 | + detectors: ["gcp", "ec2", "azure"] |
| 182 | + timeout: 2s |
| 183 | + ec2: |
| 184 | + resource_attributes: |
| 185 | + host.name: |
| 186 | + enabled: false |
| 187 | + |
| 188 | + # Gives OTEL_RESOURCE_ATTRIBUTES precedence over other sources. |
| 189 | + # host.id is set from env whenever the collector is orchestrated by NR Agents. |
| 190 | + resourcedetection/env: |
| 191 | + detectors: ["env"] |
| 192 | + timeout: 2s |
| 193 | + override: true |
| 194 | + |
14 | 195 | exporters: |
15 | 196 | otlphttp: |
16 | 197 | endpoint: ${env:OTEL_EXPORTER_OTLP_ENDPOINT:-https://otlp.nr-data.net} |
17 | 198 | headers: |
18 | 199 | api-key: ${env:NEW_RELIC_LICENSE_KEY} |
19 | 200 |
|
20 | | -extensions: |
21 | | - health_check: |
22 | | - |
23 | 201 | service: |
24 | | - extensions: [health_check] |
25 | 202 | pipelines: |
| 203 | + metrics/host: |
| 204 | + receivers: [hostmetrics] |
| 205 | + processors: |
| 206 | + - memory_limiter |
| 207 | + - metricstransform |
| 208 | + - filter/exclude_cpu_utilization |
| 209 | + - filter/exclude_memory_utilization |
| 210 | + - filter/exclude_memory_usage |
| 211 | + - filter/exclude_filesystem_utilization |
| 212 | + - filter/exclude_filesystem_usage |
| 213 | + - filter/exclude_filesystem_inodes_usage |
| 214 | + - filter/exclude_system_disk |
| 215 | + - filter/exclude_network |
| 216 | + - attributes/exclude_system_paging |
| 217 | + - transform/host |
| 218 | + - resourcedetection |
| 219 | + - resourcedetection/cloud |
| 220 | + - resourcedetection/env |
| 221 | + - cumulativetodelta |
| 222 | + - batch |
| 223 | + exporters: [otlphttp] |
| 224 | + logs/host: |
| 225 | + receivers: [filelog] |
| 226 | + processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] |
| 227 | + exporters: [otlphttp] |
26 | 228 | traces: |
27 | 229 | receivers: [otlp] |
28 | | - processors: [memory_limiter, batch] |
| 230 | + processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] |
29 | 231 | exporters: [otlphttp] |
30 | 232 | metrics: |
31 | 233 | receivers: [otlp] |
32 | | - processors: [memory_limiter, batch] |
| 234 | + processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] |
33 | 235 | exporters: [otlphttp] |
34 | 236 | logs: |
35 | 237 | receivers: [otlp] |
36 | | - processors: [memory_limiter, batch] |
| 238 | + processors: [memory_limiter, transform, resourcedetection, resourcedetection/cloud, resourcedetection/env, batch] |
37 | 239 | exporters: [otlphttp] |
| 240 | + |
| 241 | + extensions: [health_check] |
0 commit comments