influxdata / oss-ui-metrics-proxy

A simple proxy server to allow writing UI metrics to an OSS InfluxDB install

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OSS Metrics Proxy

A simple proxy server that mimics the service Influx uses to write Cloud UI metrics to an internal instance of InfluxDB

Set up

The influx daemon needs to be started with the proper flag turned on. When starting your influxd process, add the flag --feature-flags=appMetrics=true

influxd --feature-flags=appMetrics=true [--assets-path=../ui/build]

We need to set up the local InfluxDB UI to proxy requests to our metrics service. To do that, we'll modify the webpack.dev.ts file's proxy block by adding the following entry to the top of the proxy object:

proxy: {
  '/api/v2/app-metrics': 'http://localhost:3030',

from here, run yarn start from the ui directory, and you should be ready to setup and run the server:

Running (simple node method)

npm install

INFLUX_URL=http://localhost:8080 INFLUX_TOKEN=your_influx_token ORG=influx BUCKET=defbuck node index.js

Running (Docker method)

  1. Edit .env file with your proper values
  2. for INFLUX_URL see this StackOverflow post
  3. Build the server:
    docker build -t oss_metrics_proxy .
  4. Run the server:
    docker run -p 3030:3030 --env-file=.env -d oss_metrics_proxy

Testing

Hit your local homepage at http://localhost:8080/. Open your network tab. You should see a 201 from app-metrics

About

A simple proxy server to allow writing UI metrics to an OSS InfluxDB install


Languages

Language:JavaScript 86.4%Language:Dockerfile 7.6%Language:Shell 6.0%