Skip to content

Commit c77ca84

Browse files
authored
feat: enable host.name detection for ec2 (#382)
1 parent 8454328 commit c77ca84

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

distributions/nrdot-collector-host/config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ processors:
180180
resourcedetection/cloud:
181181
detectors: ["gcp", "ec2", "azure"]
182182
timeout: 2s
183-
ec2:
184-
resource_attributes:
185-
host.name:
186-
enabled: false
183+
override: true
187184

188185
# Gives OTEL_RESOURCE_ATTRIBUTES precedence over other sources.
189186
# host.id is set from env whenever the collector is orchestrated by NR Agents.

distributions/nrdot-collector-host/test/spec-nightly.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ nightly:
44
ec2:
55
enabled: true
66
testCaseSpecs:
7-
- host
7+
- host
8+
- resourcedetection

distributions/nrdot-collector/config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ processors:
180180
resourcedetection/cloud:
181181
detectors: ["gcp", "ec2", "azure"]
182182
timeout: 2s
183-
ec2:
184-
resource_attributes:
185-
host.name:
186-
enabled: false
183+
override: true
187184

188185
# Gives OTEL_RESOURCE_ATTRIBUTES precedence over other sources.
189186
# host.id is set from env whenever the collector is orchestrated by NR Agents.

distributions/nrdot-collector/test/spec-nightly.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ nightly:
44
ec2:
55
enabled: true
66
testCaseSpecs:
7-
- host
7+
- host
8+
- resourcedetection
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
whereClause:
2+
template: "WHERE testKey like '{{ .testKey }}'"
3+
vars:
4+
- testKey
5+
6+
testCases:
7+
resourcedetection/cloud.ec2_host_name:
8+
metric:
9+
# any metric processed by resourcedetection works
10+
name: system.cpu.utilization
11+
whereClause: WHERE host.name like 'ip-%'
12+
assertions:
13+
- aggregationFunction: max
14+
comparisonOperator: ">"
15+
threshold: 0

0 commit comments

Comments
 (0)