The yml configuration file in the /var/db/newrelic-infra/custom-integrations/ flexConfigs folder.
name: bespin_all_accounts
variable_store:
graphql_API_URL: https://api.newrelic.com/graphql
lookup_file: /var/db/newrelic-infra/custom-integrations/flexConfigs/bespin_accounts_lookup.json ### location of lookup file
apis:
- name: storagesampleview
event_type: customglobalstorage
url: ${var:graphql_API_URL}
method: POST
payload: >
{"query":
"{ actor { account(id: ${lf:account_id})
{nrql
(query: \"from StorageSample select latest(operatingSystem) as operatingSystem,latest(displayName) as displayName ,latest(agentVersion) as agentVersion,latest(coreCount) as coreCount, latest(diskUsedPercent) as diskUsedPercent , latest(diskTotalBytes) as diskTotalBytes , latest(diskUsedBytes) as diskUsedBytes facet displayName, mountPoint limit max \")
{results} id name } }}", "variables":""}
headers:
API-Key: ${lf:personal_API_key}
Content-Type: application/json
value_parser:
displayName: "nil"
remove_keys:
- facet
- api.StatusCode
rename_keys:
data.actor.account.id: accountID
data.actor.account.name: accountName
An issue occurs when two facet columns are entered in the query of the payload in the yml file.
If the facet is entered as a single column, the issue like the image above does not occur.
Regarding, is it possible to set facet displayName, mountPoint of query to be properly displayed in INSIGHTS?
For reference, executing the nri-flex command in the terminal returns the execution result as follows.
displayNamemountPointSamples": "[map[:DEV-DSDEVDB1] map[:F:]]
[root@GLOBALVIEW bin]# ./nri-flex --config_file /var/db/newrelic-infra/custom-integrations/flexConfigs/bespin_collect_hosts.yml -pretty
INFO[0000] com.newrelic.nri-flex GOARCH=amd64 GOOS=linux version=1.3.0
INFO[0002] flex: completed processing configs configs=3
{
"name": "com.newrelic.nri-flex",
"protocol_version": "3",
"integration_version": "1.3.0",
"data": [
{
"metrics": [
{
"accountID": 000,
"accountName": "TEST",
"agentVersion": "1.10.30",
"coreCount": 2,
"diskTotalBytes": 64298676224,
"diskUsedBytes": 62125727744,
"diskUsedPercent": 96.620537,
"displayName": "DEV-DSDEVDB1",
"displayNamemountPointSamples": "[map[:DEV-DSDEVDB1] map[:F:]]",
"event_type": "customglobalstorage",
"integration_name": "com.newrelic.nri-flex",
"integration_version": "1.3.0",
"operatingSystem": "windows"
},