mirror of
https://github.com/OutlineFoundation/outline-server.git
synced 2026-11-19 14:22:02 +00:00
* s/AccessKeyDataLimit/DefaultDataLimit/g for shadowbox * Implement per-key custom data limits in shadowbox * Shadowbox integration test * Fix the manager service test to maintain backwards compatibility with the GET /server response * Fix integration test for Travis * Fix lint errors * Implement removal of access key data limits * Persist custom data limits * Bump Shadowbox version number * Add a per key dat alimit count to the feature metrics endpoint This also involved modifying the schema of uproxysite:uproxy_metrics_dev.feature_metrics to include the new field. See https://cloud.google.com/bigquery/docs/managing-table-schemas#bq_1 for how this was accomplished Tested: yarn do metrics_server/test && yarn do metrics_server/test_integration * Collect usage metrics for per-key data limits * API documentation and cleanup * Respond to review comments * Respond to review comments * Don't encode the data limit in the access key url This should have been caught in the integration test, but the integration test was miswritten with "echo" instead of "fail", cause the test to mistakenly pass. Fixing this exposed other errors in the test, which were fixed. The test has been confirmed to both pass and fail successfully. * Fix the manager service unit test * Remove stray files * Split integration test into individual functions * Clarify comment in the AccessKey interface * Be more explicit about behavior when no data limits are set * Remove spuriosu import added by vscode * DOn't bump shadowbox version number yet * Rename to accessKeyToApiJson * Don't export AccessKeyJson and use "StorageJson" * Don't await data limit enforcement * Rename the defaultDataLimit getter * Make dataLimit in the accesskey model readonly * Use nullish coalescing operator |
||
|---|---|---|
| .. | ||
| infrastructure | ||
| app_dev.yaml | ||
| app_prod.yaml | ||
| build_action.sh | ||
| config_dev.json | ||
| config_prod.json | ||
| connection_metrics.spec.ts | ||
| connection_metrics.ts | ||
| deploy_dev_action.sh | ||
| deploy_prod_action.sh | ||
| dispatch.yaml | ||
| feature_metrics.spec.ts | ||
| feature_metrics.ts | ||
| index.ts | ||
| model.ts | ||
| package.json | ||
| README.md | ||
| run_action.sh | ||
| test_action.sh | ||
| test_integration_action.sh | ||
| tsconfig.json | ||
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
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