outline-server/src/metrics_server
2020-06-22 16:32:48 -04:00
..
infrastructure Feature metrics (#577) 2020-02-26 12:49:52 -05:00
app_dev.yaml Feature metrics (#577) 2020-02-26 12:49:52 -05:00
app_prod.yaml Feature metrics (#577) 2020-02-26 12:49:52 -05:00
build_action.sh make metrics server build script an action, update docs 2018-12-10 14:22:47 -05:00
config_dev.json Feature metrics (#577) 2020-02-26 12:49:52 -05:00
config_prod.json Feature metrics (#577) 2020-02-26 12:49:52 -05:00
connection_metrics.spec.ts Feature metrics (#577) 2020-02-26 12:49:52 -05:00
connection_metrics.ts Feature metrics (#577) 2020-02-26 12:49:52 -05:00
deploy_dev_action.sh Feature metrics (#577) 2020-02-26 12:49:52 -05:00
deploy_prod_action.sh Feature metrics (#577) 2020-02-26 12:49:52 -05:00
dispatch.yaml Feature metrics (#577) 2020-02-26 12:49:52 -05:00
feature_metrics.spec.ts Feature metrics (#577) 2020-02-26 12:49:52 -05:00
feature_metrics.ts Feature metrics (#577) 2020-02-26 12:49:52 -05:00
index.ts Update @types/express (#602) 2020-03-09 16:06:23 -04:00
model.ts Feature metrics (#577) 2020-02-26 12:49:52 -05:00
package.json Select newly added keys (#601) 2020-03-06 18:33:07 -05:00
README.md Feature metrics (#577) 2020-02-26 12:49:52 -05:00
run_action.sh Feature metrics (#577) 2020-02-26 12:49:52 -05:00
test_action.sh Fix unit tests (#693) 2020-06-22 16:32:48 -04:00
test_integration_action.sh Feature metrics (#577) 2020-02-26 12:49:52 -05:00
tsconfig.json make metrics server build script an action, update docs 2018-12-10 14:22:47 -05:00

Outline Metrics Server

The Outline Metrics Server is a Google App Engine project that writes feature and connections metrics to BigQuery, as reported by opted-in Outline servers.

API

Endpoints

The metrics server deploys two services: dev, used for development testing and debugging; and prod, used for production metrics. The dev environment is deployed to https://dev.metrics.getoutline.org; the prod environment is deployed to https://prod.metrics.getoutline.org. Each environment posts metrics to its own BigQuery dataset (see config_[dev|prod].json).

URLs

The metrics server supports two URL paths:

  • POST /connections: report server data usage broken down by user.

    {
      serverId: string,
      startUtcMs: number,
      endUtcMs: number,
      userReports: [{
          userId: string,
          countries: string[],
          bytesTransferred: number,
      }]
    }
    
  • POST /features: report feature usage.

    {
        serverId: string,
        serverVersion: string,
        timestampUtcMs: number,
        dataLimit: {
            enabled: boolean
        }
    }
    

Requirements

Build

yarn do metrics_server/build

Run

Run a local development metrics server:

yarn do metrics_server/run

Deploy

  • Authenticate with gcloud:
    gcloud auth login
    
  • To deploy to dev:
    yarn do metrics_server/deploy_dev
    
  • To deploy to prod:
    yarn do metrics_server/deploy_prod
    

Test

  • Unit test
    yarn do metrics_server/test
    
  • Integration test
    yarn do metrics_server/test_integration