outline-server/src/metrics_server
Daniel LaCosse 3574b5f5e0
chore: upgrade webpack to v5 to support lts/hydrogen (#1422)
* upgrade dependencies and fix API changes

* skipLibCheck

* attempt test fixes

* fix attempt

* stream-http

* fix final thing i think
2023-10-11 10:44:36 -04:00
..
infrastructure Feature metrics (#577) 2020-02-26 12:49:52 -05:00
app_dev.yaml fix(server): restore country metrics (#1242) 2022-12-02 10:13:59 -06:00
app_prod.yaml fix(server): restore country metrics (#1242) 2022-12-02 10:13:59 -06:00
build.action.sh Migrate from Yarn to Node lts/gallium (#1004) 2021-11-05 16:40:34 -04: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 fix(server): restore country metrics (#1242) 2022-12-02 10:13:59 -06:00
connection_metrics.ts fix(server): restore country metrics (#1242) 2022-12-02 10:13:59 -06:00
deploy_dev.action.sh fix(server): restore country metrics (#1242) 2022-12-02 10:13:59 -06:00
deploy_prod.action.sh fix(server): restore country metrics (#1242) 2022-12-02 10:13:59 -06:00
dispatch.yaml Feature metrics (#577) 2020-02-26 12:49:52 -05:00
feature_metrics.spec.ts Fix lint 2022-03-09 23:10:15 +00:00
feature_metrics.ts Migrate to eslint 2022-03-10 01:50:59 +00:00
index.ts Fix lint 2022-03-09 23:10:15 +00:00
model.ts Per-Key Data Limits in Shadowbox (#769) 2020-12-23 13:52:50 -05:00
package.json fix(server): restore country metrics (#1242) 2022-12-02 10:13:59 -06:00
README.md Fix lint 2022-03-09 23:10:15 +00:00
start.action.sh Migrate from Yarn to Node lts/gallium (#1004) 2021-11-05 16:40:34 -04:00
test.action.sh Migrate from Yarn to Node lts/gallium (#1004) 2021-11-05 16:40:34 -04:00
test_integration.action.sh Migrate from Yarn to Node lts/gallium (#1004) 2021-11-05 16:40:34 -04:00
tsconfig.json chore: upgrade webpack to v5 to support lts/hydrogen (#1422) 2023-10-11 10:44:36 -04: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
            perKeyLimitCount: number
        }
    }
    

Requirements

Build

npm run action metrics_server/build

Run

Run a local development metrics server:

npm run action metrics_server/start

Deploy

  • Authenticate with gcloud:
    gcloud auth login
    
  • To deploy to dev:
    npm run action metrics_server/deploy_dev
    
  • To deploy to prod:
    npm run action metrics_server/deploy_prod
    

Test

  • Unit test
    npm run action metrics_server/test
    
  • Integration test
    npm run action metrics_server/test_integration