Skip to content

Commit 43acbe1

Browse files
committed
feat: deprecate legacy integration attributes
* remove integration_version and integration_name * introduce a config to control if these attributes need to be set
1 parent cfe31ca commit 43acbe1

File tree

23 files changed

+116
-221
lines changed

23 files changed

+116
-221
lines changed

cmd/nri-flex/nri-flex_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ func TestConfigDir(t *testing.T) {
5858
fintegration.RunFlex(r)
5959
expectedSamples := []string{
6060
`{"event_type":"flexStatusSample","flex.IntegrationVersion":"Unknown-SNAPSHOT","flex.counter.ConfigsProcessed":3,"flex.counter.EventCount":3,"flex.counter.EventDropCount":0,"flex.counter.MessageSample":2,"flex.counter.commandJsonOutSample":1}`,
61-
`{"error":"true","event_type":"MessageSample","integration_name":"com.newrelic.nri-flex","integration_version":"Unknown-SNAPSHOT","message":"bye","value":20.9}`,
62-
`{"error":"false","event_type":"MessageSample","integration_name":"com.newrelic.nri-flex","integration_version":"Unknown-SNAPSHOT","message":"hello","value":100}`,
63-
`{"completed":"false","event_type":"commandJsonOutSample","id":1,"integration_name":"com.newrelic.nri-flex",` +
64-
`"integration_version":"Unknown-SNAPSHOT","myCustomAttr":"theValue","title":"delectus aut autem","userId":1}`}
61+
`{"error":"true","event_type":"MessageSample","message":"bye","value":20.9}`,
62+
`{"error":"false","event_type":"MessageSample","message":"hello","value":100}`,
63+
`{"completed":"false","event_type":"commandJsonOutSample","id":1,` +
64+
`"myCustomAttr":"theValue","title":"delectus aut autem","userId":1}`}
6565
testSamples(expectedSamples, load.Entity.Metrics, t)
6666
}
6767

@@ -74,7 +74,7 @@ func TestConfigFile(t *testing.T) {
7474
fintegration.RunFlex(r)
7575
expectedSamples := []string{
7676
`{"event_type":"flexStatusSample","flex.IntegrationVersion":"Unknown-SNAPSHOT","flex.counter.ConfigsProcessed":1,"flex.counter.EventCount":1,"flex.counter.EventDropCount":0,"flex.counter.commandJsonOutSample":1}`,
77-
`{"completed":"false","event_type":"commandJsonOutSample","id":1,"integration_name":"com.newrelic.nri-flex",` +
78-
`"integration_version":"Unknown-SNAPSHOT","myCustomAttr":"theValue","title":"delectus aut autem","userId":1}`}
77+
`{"completed":"false","event_type":"commandJsonOutSample","id":1,` +
78+
`"myCustomAttr":"theValue","title":"delectus aut autem","userId":1}`}
7979
testSamples(expectedSamples, load.Entity.Metrics, t)
8080
}

docs/apis/commands.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,10 @@ The `split_output` command as defined above gets two blocks of data to which Fle
201201
[
202202
{
203203
"event_type": "splitOutputSample",
204-
"integration_name": "com.newrelic.nri-flex",
205204
"value": "value"
206205
},
207206
{
208207
"event_type": "splitOutputSample",
209-
"integration_name": "com.newrelic.nri-flex",
210208
"value": "otherValue"
211209
}
212210
]

docs/apis/url.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ Given the following output for each metric:
139139
```json
140140
{
141141
"event_type": "ExampleSample",
142-
"integration_name": "com.newrelic.nri-flex",
143-
"integration_version": "version-number",
144142
"id": 1,
145143
"completed": "true",
146144
"api.StatusCode": 200,

docs/basics/functions.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,6 @@ Which would return the following:
771771
"api.StatusCode": 200,
772772
"customerId": "abc",
773773
"event_type": "usageInfoSample",
774-
"integration_name": "com.newrelic.nri-flex",
775-
"integration_version": "Unknown-SNAPSHOT",
776774
"quantities": 10
777775
},
778776
]
@@ -820,8 +818,6 @@ Which would return the following:
820818
"api.StatusCode": 200,
821819
"customerId": "xyz",
822820
"event_type": "usageInfoSample",
823-
"integration_name": "com.newrelic.nri-flex",
824-
"integration_version": "Unknown-SNAPSHOT",
825821
"quantities": 20
826822
},
827823
]
@@ -1015,27 +1011,21 @@ Which would return the following:
10151011
"Value": 200,
10161012
"accountid": "AccountA",
10171013
"event_type": "myMetricsSample",
1018-
"index": 0,
1019-
"integration_name": "com.newrelic.nri-flex",
1020-
"integration_version": "Unknown-SNAPSHOT"
1014+
"index": 0
10211015
},
10221016
{
10231017
"Timestamp": 1585662958000,
10241018
"Value": 190,
10251019
"accountid": "AccountA",
10261020
"event_type": "myMetricsSample",
1027-
"index": 1,
1028-
"integration_name": "com.newrelic.nri-flex",
1029-
"integration_version": "Unknown-SNAPSHOT"
1021+
"index": 1
10301022
},
10311023
{
10321024
"Timestamp": 1585662959000,
10331025
"Value": 180,
10341026
"accountid": "AccountA",
10351027
"event_type": "myMetricsSample",
1036-
"index": 2,
1037-
"integration_name": "com.newrelic.nri-flex",
1038-
"integration_version": "Unknown-SNAPSHOT"
1028+
"index": 2
10391029
}
10401030
]
10411031
```

docs/experimental/functions.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ Which would return the following:
221221
"incidentCode": 77,
222222
"serviceId": "compute",
223223
"event_type": "usageInfoSample",
224-
"integration_name": "com.newrelic.nri-flex",
225-
"integration_version": "Unknown-SNAPSHOT",
226224
"quantities": 10
227225
},
228226
]

docs/experimental/git_sync.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ GIT_TOKEN=13nasdasj13jadf
1717
## Setting in nri-flex-config.yml
1818
```yaml
1919
### /etc/newrelic-infra/integrations.d/nri-flex-config.yml
20-
integration_name: com.newrelic.nri-flex
2120

2221
instances:
2322
- name: nri-flex

docs/troubleshooting.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ INFO[0004] flex: completed processing configs configs=1
7777
"avg": 17.491,
7878
"event_type": "pingTest",
7979
"flex.commandTimeMs": 4029,
80-
"integration_name": "com.newrelic.nri-flex",
81-
"integration_version": "1.3.5",
8280
"max": 17.55,
8381
"min": 17.425,
8482
"packetLoss": 0,
@@ -152,8 +150,6 @@ This next section leads into the more interesting part of the payload, but you c
152150
"avg": 17.491,
153151
"event_type": "pingTest",
154152
"flex.commandTimeMs": 4029,
155-
"integration_name": "com.newrelic.nri-flex",
156-
"integration_version": "1.3.5",
157153
"max": 17.55,
158154
"min": 17.425,
159155
"packetLoss": 0,
@@ -221,8 +217,6 @@ Payload:
221217
"error_exec": "echo \"key:5\" \u0026\u0026 sleep 2",
222218
"error_msg": "key:5\n",
223219
"event_type": "TimeoutSample",
224-
"integration_name": "com.newrelic.nri-flex",
225-
"integration_version": "1.4.1"
226220
}
227221
],
228222
"inventory": {},

examples/Oracle/SiebelCRM/README.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ This is the same as doing ```list tasks``` in Siebel server manager.
6565
"instanceType": "VMware, Inc. VMware7,1",
6666
"integrationName": "com.newrelic.nri-flex",
6767
"integrationVersion": "1.5.1",
68-
"integration_name": "com.newrelic.nri-flex",
69-
"integration_version": "1.5.1",
7068
"nr.entityType": "HOST",
7169
"nr.ingestTimeMs": 1667178571000,
7270
"nr.invalidAttributeCount": 2,
@@ -167,8 +165,6 @@ This is the same as doing ```list sessions``` in Siebel server manager.
167165
"instanceType": "VMware, Inc. VMware7,1",
168166
"integrationName": "com.newrelic.nri-flex",
169167
"integrationVersion": "1.5.1",
170-
"integration_name": "com.newrelic.nri-flex",
171-
"integration_version": "1.5.1",
172168
"nr.entityType": "HOST",
173169
"nr.ingestTimeMs": 1667191082000,
174170
"nr.invalidAttributeCount": 2,
@@ -266,8 +262,6 @@ This is the same as doing ```server status``` in Siebel server manager.
266262
"instanceType": "VMware, Inc. VMware7,1",
267263
"integrationName": "com.newrelic.nri-flex",
268264
"integrationVersion": "1.5.1",
269-
"integration_name": "com.newrelic.nri-flex",
270-
"integration_version": "1.5.1",
271265
"nr.entityType": "HOST",
272266
"nr.ingestTimeMs": 1667191261000,
273267
"nr.invalidAttributeCount": 2,
@@ -372,8 +366,6 @@ This is the same as doing ```list components``` in Siebel server manager.
372366
"instanceType": "VMware, Inc. VMware7,1",
373367
"integrationName": "com.newrelic.nri-flex",
374368
"integrationVersion": "1.5.1",
375-
"integration_name": "com.newrelic.nri-flex",
376-
"integration_version": "1.5.1",
377369
"nr.entityType": "HOST",
378370
"nr.ingestTimeMs": 1667191441000,
379371
"nr.invalidAttributeCount": 2,
@@ -466,8 +458,6 @@ This is the same as doing ```<SERVERNAME> statistics``` in Siebel server manager
466458
"instanceType": "VMware, Inc. VMware7,1",
467459
"integrationName": "com.newrelic.nri-flex",
468460
"integrationVersion": "1.5.1",
469-
"integration_name": "com.newrelic.nri-flex",
470-
"integration_version": "1.5.1",
471461
"nr.entityType": "HOST",
472462
"nr.ingestTimeMs": 1667191531000,
473463
"nr.invalidAttributeCount": 2,

examples/linux/netdiscover.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ integrations:
6060
# {
6161
# "count": 1,
6262
# "event_type": "NetDiscoverSample",
63-
# "integration_name": "com.newrelic.nri-flex",
64-
# "integration_version": "1.0.0",
6563
# "ipAddress": "192.168.0.121",
6664
# "len": 60,
6765
# "macAddress": "b0:59:47:8a:8d:8d",

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ require (
3131
github.com/stretchr/testify v1.11.1
3232
github.com/vertica/vertica-sql-go v1.3.4
3333
go.uber.org/ratelimit v0.3.1
34-
golang.org/x/crypto v0.37.0
35-
golang.org/x/net v0.39.0
34+
golang.org/x/crypto v0.40.0
35+
golang.org/x/net v0.42.0
3636
gopkg.in/yaml.v2 v2.4.0
3737
gotest.tools v2.2.0+incompatible
3838
)
@@ -117,7 +117,7 @@ require (
117117
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
118118
go.opentelemetry.io/otel/trace v1.34.0 // indirect
119119
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
120-
golang.org/x/sys v0.32.0 // indirect
120+
golang.org/x/sys v0.34.0 // indirect
121121
golang.org/x/text v0.28.0 // indirect
122122
google.golang.org/protobuf v1.36.5 // indirect
123123
gopkg.in/warnings.v0 v0.1.2 // indirect

0 commit comments

Comments
 (0)