Receives and translates metrics from Wavefront Proxy and translates them to DX
npm install dx-wavefront-proxy-adapterAccepts traffic from a Wavefront Proxy and allows conversion of metrics to the DX Platform
1. Configure and start an instance of the WaveFront Proxy Adapter
2. Point the WaveFront Proxy to the http endpoint of the WaveFront Proxy Adapter
3. Inspect adapter's discovery directory for discovered metrics and customize/move configurations to adapter cconfiguration directory
4. Verify metrics
Install nvm
```
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
Install Node/NPM 18/10 using nvm
``
nvm install 18
Use npm's npx to execute
`bash`
npx dx-wavefront-proxy-adapter@latest --help
#### Comma Separated List, Available levels: ERROR,WARN,LOG,DEBUG
``
DX_WFPA_LOG_LEVELS=error,warn
#### When running from container, this should be a writeable PV claim dedicated to the instance.
``
DX_WFP_ADAPTER_DISCOVERY_DIRECTORY=/var/df-wfpa/discovery
#### When running from container, this should be a readmany PV claim available to all instances.
`
DX_WFP_ADAPTER_CONFIGURATIONS_DIRECTORY=/var/df-wfpa/configurations
`$3
Configuration file containing tenant identification, tokens and endpoints.#### When running from container, this should be provided by a secret.
`
DX_TENANT_CONFIG_FILE=/var/secrets/dx-config.json
`Example dx tenant configuration file:
`
{
"configurationVersion": "3",
"tenantId": "",
"tenantCN": "",
"hostUrl": "https://apmgw.dxi-na1.saas.broadcom.com/",
"dashboardHostUrl": "https://dxi-dashboard.dxi-na1.saas.broadcom.com/",
"tenantToken": " "userToken": ""
}
`$3
The port to which the Wavefront Proxy or intermediate nginx will deliver data. You must point the Wavefront Proxy to this port (or an ingress intermediary)#### When running from container, this port must be EXPOSE'd
`
DX_WFPA_LISTEN_PORT=2401
`$3
The maximum request body size that the Proxy Adapter will accept.#### Wavefront Proxy defaults appear to be 16mb, but intermittent payloads seem to exceed this by several bytes, hence a default of 17mb.
`
DX_WFPA_REQUEST_BODY_BYTES_MAX=17mb
`$3
The maximum number of failed datapoints queued for later sending before backpressure is exerted on the WaveFront Proxy#### The default for this is 10000 datapoints, which should require about 1.7MB of memory.
#### 1000000 (1M) datapoints require approximately 170MB, which require changes to the node memory settings.
`
DX_WFP_ADAPTER_MAX_ENQUEUED_DATA_POINTS=1000000
`$3
#### Pass the memory limit increase (in MB) on the node command line, example below is setting memory to 1000MB = 1GB.
`
--max-old-space-size=1000
`
Metric Configuration
The metric configuration schema can be dumped using
npx dx-wavefront-proxy-adapter@latest --dumpConfigurationSchemaSupported Interpolation
$3
${tag: will be the value of the tag, or unknown if the tag does not exist.$3
* ${mp: will be replaced with the 1-starting index of the wavefront metric name split using "."
* for a.b.c
* ${mp:1} = a
* ${mp:2} = b
* ${mp:3} = c,
* ${mp:0} will be replaced with the entire unsplit metric
* for a.b.c, ${mp:0} will be a.b.c
* ${mp:- will be replaced with the 1-ending index from the end of the wavefront metric name split using "."
* ${mp:-1} = c
* ${mp:-2} = b
* ${mp:-3} = a,
$3
* ${mmps: will be replaced with a range of metric parts where
* start_index is a 1-starting index of all parts of the metric when split on "." character.
* start_index may not be less than 1.
* end_index expression may be
-- all subsequent parts
* given metric a.b.c.d.e
${mmps:1::|} = a|b|c|d|e
${mmps:2::|} = b|c|d|e
* + next num_parts parts.
* given metric a.b.c.d.e
* ${mmps:1:+1:|} = a|b
* ${mmps:1:+3:|} = a|b|c|d
* ${mmps:1:+5:|} = a|b|c|d|e [allows and ignores index after max parts]
* - parts until and NOT including the parts_from_end-th element.
* given metric a.b.c.d.e
* ${mmps:1:-2:|} = a|b|c
* ${mmps:1:-1:|} = a|b|c|d
* ${mmps:1:-0:|} = a|b|c|d|e
* given metric a.b
* ${mmps:1:-1:|} = a
* ${mmps:2:-1:|} = b
* given metric a
* ${mmps:1:-1:|} = a
* only resource parts of the configuration may use "|" join character (may not use ':')
* metric part of configuration may use any character except '|' or ':'
* source segment[1,2,3] may NOT use '|' or ':', safest to use '_'
$3
3 environment variables control the naming of the agent under which the adapter's sustainability metrics are reported:
`
DX_WFP_ADAPTER_SUSTAINABILITY_HOSTNAME
DX_WFP_ADAPTER_SUSTAINABILITY_PROCESS
DX_WFP_ADAPTER_SUSTAINABILITY_AGENT
`
Source Installation
`bash
$ npm install
`Before running configure .env or environment variables
If connecting to development / self-signed cert tenant, set
`
ALLOW_INSECURE_HTTPS=true
`$3
`
$ npm run start:dev
`Test
`bash
unit tests
$ npm run teste2e tests
$ npm run test:e2etest coverage
$ npm run test:cov
``