dx-wavefront-proxy-adapter
v0.2.19
Published
Receives and translates metrics from Wavefront Proxy and translates them to DX
Downloads
57
Readme
dx-wavefront-proxy-adapter
Description
Accepts traffic from a Wavefront Proxy and allows conversion of metrics to the DX Platform
High Level Usage
- Configure and start an instance of the WaveFront Proxy Adapter
- Point the WaveFront Proxy to the http endpoint of the WaveFront Proxy Adapter
- Inspect adapter's discovery directory for discovered metrics and customize/move configurations to adapter cconfiguration directory
- Verify metrics
Test / Temporary Execution
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
npx dx-wavefront-proxy-adapter@latest --help
Environment Variable Configuration parameters
Log Levels
Comma Separated List, Available levels: ERROR,WARN,LOG,DEBUG
DX_WFPA_LOG_LEVELS=error,warn
Discovery Directory
Where detected metrics generated configurations will be written to. Each execution will overwrite existing files.
When running from container, this should be a writeable PV claim dedicated to the instance.
DX_WFP_ADAPTER_DISCOVERY_DIRECTORY=/var/df-wfpa/discovery
Configuration Directory
Where live configuration files will be read from. configuration files all must end in the suffix metric.config.yaml
When running from container, this should be a readmany PV claim available to all instances.
DX_WFP_ADAPTER_CONFIGURATIONS_DIRECTORY=/var/df-wfpa/configurations
DX Tenant configuration file
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": "<number from apmgw url path segment>",
"tenantCN": "<tenant name>",
"hostUrl": "https://apmgw.dxi-na1.saas.broadcom.com/",
"dashboardHostUrl": "https://dxi-dashboard.dxi-na1.saas.broadcom.com/",
"tenantToken": "<tenant token",
"userToken": "<user token>"
}
Proxy Adapter Listen Port
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
Proxy Adaptor maximum request body size
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
Proxy Adaptor maximum enqueued datapoints
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
Increasing Proxy Adaptor memory
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 --dumpConfigurationSchema
Supported Interpolation
tag
${tag:<tagname>}
will be the value of the tag, or unknown
if the tag does not exist.
metric part
${mp:<index>}
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
,
- for
${mp:0}
will be replaced with the entire unsplit metric- for
a.b.c
,${mp:0}
will bea.b.c
- for
${mp:-<index>}
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
,
multiple metric parts
${mmps:<start_index>:<end_index_expression>:<join_characters>
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
- given metric
+<num_parts>
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]
- given metric
-<parts_from_end>
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
- given metric
- 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 '_'
Sustainability Configuration
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
$ npm install
Before running configure .env or environment variables
If connecting to development / self-signed cert tenant, set
ALLOW_INSECURE_HTTPS=true
Run in dev mode
$ npm run start:dev
Test
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov