npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

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

  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

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,
  • ${mp:0} will be replaced with the entire unsplit metric
    • for a.b.c, ${mp:0} will be a.b.c
  • ${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
      • +<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]
      • -<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
  • 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