mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add optional telemetry to grist-core
Summary: Adds support for optional telemetry to grist-core. A new environment variable, GRIST_TELEMETRY_LEVEL, controls the level of telemetry collected. Test Plan: Server and unit tests. Reviewers: paulfitz Reviewed By: paulfitz Subscribers: dsagal, anaisconce Differential Revision: https://phab.getgrist.com/D3880
This commit is contained in:
@@ -4,6 +4,7 @@ import {EngineCode} from 'app/common/DocumentSettings';
|
||||
import {encodeQueryParams, isAffirmative} from 'app/common/gutil';
|
||||
import {LocalPlugin} from 'app/common/plugin';
|
||||
import {StringUnion} from 'app/common/StringUnion';
|
||||
import {TelemetryLevel} from 'app/common/Telemetry';
|
||||
import {UIRowId} from 'app/common/UIRowId';
|
||||
import {getGristConfig} from 'app/common/urlUtils';
|
||||
import {Document} from 'app/common/UserAPI';
|
||||
@@ -627,6 +628,12 @@ export interface GristLoadConfig {
|
||||
|
||||
// Current user locale, read from the user options;
|
||||
userLocale?: string;
|
||||
|
||||
// Telemetry config.
|
||||
telemetry?: TelemetryConfig;
|
||||
|
||||
// The Grist deployment type (e.g. core, enterprise).
|
||||
deploymentType?: GristDeploymentType;
|
||||
}
|
||||
|
||||
export const Features = StringUnion(
|
||||
@@ -648,6 +655,13 @@ export function getPageTitleSuffix(config?: GristLoadConfig) {
|
||||
return config?.pageTitleSuffix ?? " - Grist";
|
||||
}
|
||||
|
||||
export interface TelemetryConfig {
|
||||
telemetryLevel: TelemetryLevel;
|
||||
}
|
||||
|
||||
export const GristDeploymentTypes = StringUnion('saas', 'core', 'enterprise', 'electron', 'static');
|
||||
export type GristDeploymentType = typeof GristDeploymentTypes.type;
|
||||
|
||||
/**
|
||||
* For a packaged version of Grist that requires activation, this
|
||||
* summarizes the current state. Not applicable to grist-core.
|
||||
|
||||
Reference in New Issue
Block a user