History

Drop integration slugs from analytics events

Rhys Sullivan committed 3 months ago

Commit 668cec41 parent 49095aa4 files · +10 −16Browse files

Unified · Split

4 files
  1. apps/host-selfhost/src/execution.ts +1 −1
  2. apps/local/src/executor.ts +1 −1
  3. packages/core/analytics/src/analytics.test.ts +1 −4
  4. packages/core/analytics/src/events.ts +7 −10
apps/host-selfhost/src/execution.ts+1−1
@@ -58,7 +58,7 @@ export const SelfHostHostConfig: Layer.Layer<HostConfig> = Layer.sync(HostConfig · 57 unmodified lines
5858 onIntegrationChange: (event) =>
5959 selfHostAnalytics.record(
6060 event.kind === "added" ? "integration_added" : "integration_removed",
61− { plugin_key: event.pluginKey, integration_slug: String(event.slug) },
61+ { plugin_key: event.pluginKey },
6262 ),
6363 };
6464 });
apps/local/src/executor.ts+1−1
@@ -199,7 +199,7 @@ const createLocalExecutorLayer = (options: LocalExecutorOptions = {}) => { · 198 unmodified lines
199199 onIntegrationChange: (event) =>
200200 localAnalytics.record(
201201 event.kind === "added" ? "integration_added" : "integration_removed",
202− { plugin_key: event.pluginKey, integration_slug: String(event.slug) },
202+ { plugin_key: event.pluginKey },
203203 ),
204204 onElicitation: "accept-all",
205205 oauthEndpointUrlPolicy: { allowHttp: true },
packages/core/analytics/src/analytics.test.ts+1−4
@@ -94,10 +94,7 @@ describe("Analytics", () => { · 93 unmodified lines
9494 plane: "mcp",
9595 toolkit: false,
9696 });
97− yield* analytics.record("integration_added", {
98− plugin_key: "openapi",
99− integration_slug: "github",
100− });
97+ yield* analytics.record("integration_added", { plugin_key: "openapi" });
10198 yield* analytics.flush;
10299
103100 const batches = yield* Ref.get(http.batches);
packages/core/analytics/src/events.ts+7−10
@@ -13,8 +13,11 @@ · 12 unmodified lines
1313 // - Never secrets, tokens, credentials, code, tool arguments or results.
1414 // - Never user free text: no connection names, no tool addresses, no
1515 // toolkit slugs (user-entered labels — send booleans/counts instead).
16−// - Integration slugs and plugin keys ARE allowed (spec-derived vocabulary,
17−// matching the browser catalog's `integration_slug` / `plugin_key`).
16+// - Plugin keys (`openapi`, `mcp`, `graphql`, ...) ARE allowed: a fixed,
17+// product-defined vocabulary. Integration slugs are NOT — stricter than
18+// the browser catalog: these events leave the user's own infrastructure,
19+// and WHICH integrations someone uses is their business, not ours. The
20+// kind of integration is the product question; the slug is not.
1821 // - Identity is the anonymous per-install id only; no emails, no hostnames,
1922 // no person or org names.
2023 // ---------------------------------------------------------------------------
@@ -48,15 +51,9 @@ export interface AnalyticsEvents { · 27 unmodified lines
4851 readonly toolkit: boolean;
4952 };
5053 /** An integration row was created (upsert re-registers are not counted). */
51− integration_added: {
52− readonly plugin_key: string;
53− readonly integration_slug: string;
54− };
54+ integration_added: { readonly plugin_key: string };
5555 /** An integration was removed by the user. */
56− integration_removed: {
57− readonly plugin_key: string;
58− readonly integration_slug: string;
59− };
56+ integration_removed: { readonly plugin_key: string };
6057 /** A generative-UI artifact was saved as a new row. */
6158 artifact_created: { readonly via: ArtifactVia };
6259 /**