Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions cmd/nri-flex/nri-flex_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//+build linux darwin
//go:build linux || darwin
// +build linux darwin

/*
* Copyright 2019 New Relic Corporation. All rights reserved.
Expand Down Expand Up @@ -57,11 +58,20 @@ func TestConfigDir(t *testing.T) {
r := fintegration.GetTestRuntime()
fintegration.RunFlex(r)
expectedSamples := []string{
`{"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}`,
`{"error":"true","event_type":"MessageSample","integration_name":"com.newrelic.nri-flex","integration_version":"Unknown-SNAPSHOT","message":"bye","value":20.9}`,
`{"error":"false","event_type":"MessageSample","integration_name":"com.newrelic.nri-flex","integration_version":"Unknown-SNAPSHOT","message":"hello","value":100}`,
`{"event_type":"flexStatusSample","flex.IntegrationVersion":"Unknown-SNAPSHOT","flex.counter.ConfigsProcessed":6,` +
`"flex.counter.EventCount":6,"flex.counter.EventDropCount":0,"flex.counter.MessageLegacySample":2,` +
`"flex.counter.MessageSample":2,"flex.counter.commandJsonOutSample":2}`,
`{"error":"true","event_type":"MessageSample","message":"bye","value":20.9}`,
`{"error":"false","event_type":"MessageSample","message":"hello","value":100}`,
`{"error":"true","event_type":"MessageLegacySample","integration_name":"com.newrelic.nri-flex",` +
`"integration_version":"Unknown-SNAPSHOT","message":"bye","value":20.9}`,
`{"error":"false","event_type":"MessageLegacySample","integration_name":"com.newrelic.nri-flex",` +
`"integration_version":"Unknown-SNAPSHOT","message":"hello","value":100}`,
`{"completed":"false","event_type":"commandJsonOutSample","id":1,` +
`"myCustomAttr":"theValue","title":"delectus aut autem","userId":1}`,
`{"completed":"false","event_type":"commandJsonOutSample","id":1,"integration_name":"com.newrelic.nri-flex",` +
`"integration_version":"Unknown-SNAPSHOT","myCustomAttr":"theValue","title":"delectus aut autem","userId":1}`}
`"integration_version":"Unknown-SNAPSHOT","myCustomAttr":"theValue","title":"delectus aut autem","userId":1}`,
}
testSamples(expectedSamples, load.Entity.Metrics, t)
}

Expand All @@ -74,7 +84,7 @@ func TestConfigFile(t *testing.T) {
fintegration.RunFlex(r)
expectedSamples := []string{
`{"event_type":"flexStatusSample","flex.IntegrationVersion":"Unknown-SNAPSHOT","flex.counter.ConfigsProcessed":1,"flex.counter.EventCount":1,"flex.counter.EventDropCount":0,"flex.counter.commandJsonOutSample":1}`,
`{"completed":"false","event_type":"commandJsonOutSample","id":1,"integration_name":"com.newrelic.nri-flex",` +
`"integration_version":"Unknown-SNAPSHOT","myCustomAttr":"theValue","title":"delectus aut autem","userId":1}`}
`{"completed":"false","event_type":"commandJsonOutSample","id":1,` +
`"myCustomAttr":"theValue","title":"delectus aut autem","userId":1}`}
testSamples(expectedSamples, load.Entity.Metrics, t)
}
2 changes: 0 additions & 2 deletions docs/apis/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,10 @@ The `split_output` command as defined above gets two blocks of data to which Fle
[
{
"event_type": "splitOutputSample",
"integration_name": "com.newrelic.nri-flex",
"value": "value"
},
{
"event_type": "splitOutputSample",
"integration_name": "com.newrelic.nri-flex",
"value": "otherValue"
}
]
Expand Down
2 changes: 0 additions & 2 deletions docs/apis/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ Given the following output for each metric:
```json
{
"event_type": "ExampleSample",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "version-number",
"id": 1,
"completed": "true",
"api.StatusCode": 200,
Expand Down
16 changes: 3 additions & 13 deletions docs/basics/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,6 @@ Which would return the following:
"api.StatusCode": 200,
"customerId": "abc",
"event_type": "usageInfoSample",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "Unknown-SNAPSHOT",
"quantities": 10
},
]
Expand Down Expand Up @@ -820,8 +818,6 @@ Which would return the following:
"api.StatusCode": 200,
"customerId": "xyz",
"event_type": "usageInfoSample",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "Unknown-SNAPSHOT",
"quantities": 20
},
]
Expand Down Expand Up @@ -1015,27 +1011,21 @@ Which would return the following:
"Value": 200,
"accountid": "AccountA",
"event_type": "myMetricsSample",
"index": 0,
"integration_name": "com.newrelic.nri-flex",
"integration_version": "Unknown-SNAPSHOT"
"index": 0
},
{
"Timestamp": 1585662958000,
"Value": 190,
"accountid": "AccountA",
"event_type": "myMetricsSample",
"index": 1,
"integration_name": "com.newrelic.nri-flex",
"integration_version": "Unknown-SNAPSHOT"
"index": 1
},
{
"Timestamp": 1585662959000,
"Value": 180,
"accountid": "AccountA",
"event_type": "myMetricsSample",
"index": 2,
"integration_name": "com.newrelic.nri-flex",
"integration_version": "Unknown-SNAPSHOT"
"index": 2
}
]
```
Expand Down
2 changes: 0 additions & 2 deletions docs/experimental/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,6 @@ Which would return the following:
"incidentCode": 77,
"serviceId": "compute",
"event_type": "usageInfoSample",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "Unknown-SNAPSHOT",
"quantities": 10
},
]
Expand Down
1 change: 0 additions & 1 deletion docs/experimental/git_sync.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ GIT_TOKEN=13nasdasj13jadf
## Setting in nri-flex-config.yml
```yaml
### /etc/newrelic-infra/integrations.d/nri-flex-config.yml
integration_name: com.newrelic.nri-flex

instances:
- name: nri-flex
Expand Down
6 changes: 0 additions & 6 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ INFO[0004] flex: completed processing configs configs=1
"avg": 17.491,
"event_type": "pingTest",
"flex.commandTimeMs": 4029,
"integration_name": "com.newrelic.nri-flex",
"integration_version": "1.3.5",
"max": 17.55,
"min": 17.425,
"packetLoss": 0,
Expand Down Expand Up @@ -152,8 +150,6 @@ This next section leads into the more interesting part of the payload, but you c
"avg": 17.491,
"event_type": "pingTest",
"flex.commandTimeMs": 4029,
"integration_name": "com.newrelic.nri-flex",
"integration_version": "1.3.5",
"max": 17.55,
"min": 17.425,
"packetLoss": 0,
Expand Down Expand Up @@ -221,8 +217,6 @@ Payload:
"error_exec": "echo \"key:5\" \u0026\u0026 sleep 2",
"error_msg": "key:5\n",
"event_type": "TimeoutSample",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "1.4.1"
}
],
"inventory": {},
Expand Down
10 changes: 0 additions & 10 deletions examples/Oracle/SiebelCRM/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ This is the same as doing ```list tasks``` in Siebel server manager.
"instanceType": "VMware, Inc. VMware7,1",
"integrationName": "com.newrelic.nri-flex",
"integrationVersion": "1.5.1",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "1.5.1",
"nr.entityType": "HOST",
"nr.ingestTimeMs": 1667178571000,
"nr.invalidAttributeCount": 2,
Expand Down Expand Up @@ -167,8 +165,6 @@ This is the same as doing ```list sessions``` in Siebel server manager.
"instanceType": "VMware, Inc. VMware7,1",
"integrationName": "com.newrelic.nri-flex",
"integrationVersion": "1.5.1",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "1.5.1",
"nr.entityType": "HOST",
"nr.ingestTimeMs": 1667191082000,
"nr.invalidAttributeCount": 2,
Expand Down Expand Up @@ -266,8 +262,6 @@ This is the same as doing ```server status``` in Siebel server manager.
"instanceType": "VMware, Inc. VMware7,1",
"integrationName": "com.newrelic.nri-flex",
"integrationVersion": "1.5.1",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "1.5.1",
"nr.entityType": "HOST",
"nr.ingestTimeMs": 1667191261000,
"nr.invalidAttributeCount": 2,
Expand Down Expand Up @@ -372,8 +366,6 @@ This is the same as doing ```list components``` in Siebel server manager.
"instanceType": "VMware, Inc. VMware7,1",
"integrationName": "com.newrelic.nri-flex",
"integrationVersion": "1.5.1",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "1.5.1",
"nr.entityType": "HOST",
"nr.ingestTimeMs": 1667191441000,
"nr.invalidAttributeCount": 2,
Expand Down Expand Up @@ -466,8 +458,6 @@ This is the same as doing ```<SERVERNAME> statistics``` in Siebel server manager
"instanceType": "VMware, Inc. VMware7,1",
"integrationName": "com.newrelic.nri-flex",
"integrationVersion": "1.5.1",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "1.5.1",
"nr.entityType": "HOST",
"nr.ingestTimeMs": 1667191531000,
"nr.invalidAttributeCount": 2,
Expand Down
2 changes: 0 additions & 2 deletions examples/linux/netdiscover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ integrations:
# {
# "count": 1,
# "event_type": "NetDiscoverSample",
# "integration_name": "com.newrelic.nri-flex",
# "integration_version": "1.0.0",
# "ipAddress": "192.168.0.121",
# "len": 60,
# "macAddress": "b0:59:47:8a:8d:8d",
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ require (
github.com/stretchr/testify v1.11.1
github.com/vertica/vertica-sql-go v1.3.4
go.uber.org/ratelimit v0.3.1
golang.org/x/crypto v0.37.0
golang.org/x/net v0.39.0
golang.org/x/crypto v0.40.0
golang.org/x/net v0.42.0
gopkg.in/yaml.v2 v2.4.0
gotest.tools v2.2.0+incompatible
)
Expand Down Expand Up @@ -117,7 +117,7 @@ require (
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
go.opentelemetry.io/otel/trace v1.34.0 // indirect
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
golang.org/x/sys v0.32.0 // indirect
golang.org/x/sys v0.34.0 // indirect
golang.org/x/text v0.28.0 // indirect
google.golang.org/protobuf v1.36.5 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
Expand Down
Loading
Loading