diff --git a/.env.example b/.env.example index b39f2a219..66772d04d 100644 --- a/.env.example +++ b/.env.example @@ -7,9 +7,9 @@ POSTHOG_HOST=https://us.i.posthog.com POSTHOG_PROJECT_ID= # @ngaf/telemetry (libs/telemetry) -# Default ingest URL points to the future Spec 1D reverse proxy. Self-hosters +# Default ingest URL points to the Cacheplane website reverse proxy. Self-hosters # can redirect to their own ingest. See libs/telemetry/README.md. -# NGAF_TELEMETRY_INGEST_URL=https://cacheplane.dev/api/ingest +# NGAF_TELEMETRY_INGEST_URL=https://cacheplane.ai/api/ingest # NGAF_TELEMETRY_SAMPLE_RATE=1.0 # DO_NOT_TRACK=1 # cross-vendor opt-out # NGAF_TELEMETRY_DISABLED=1 # package-specific opt-out diff --git a/libs/telemetry/README.md b/libs/telemetry/README.md index 4939ad936..b248ea87d 100644 --- a/libs/telemetry/README.md +++ b/libs/telemetry/README.md @@ -107,7 +107,7 @@ Enterprise users can redirect Node telemetry to their own ingest: NGAF_TELEMETRY_INGEST_URL=https://telemetry.acme-internal.example.com/api/ingest ``` -Default ingest (when env var is unset) is a thin proxy on the Cacheplane website (`https://cacheplane.dev/api/ingest`) that accepts the `@ngaf/telemetry` JSON payload and forwards `ngaf:*` events to our PostHog project without forwarding installer IP addresses. Source of the proxy lives in `apps/website/src/app/api/ingest/`. +Default ingest (when env var is unset) is a thin proxy on the Cacheplane website (`https://cacheplane.ai/api/ingest`) that accepts the `@ngaf/telemetry` JSON payload and forwards `ngaf:*` events to our PostHog project without forwarding installer IP addresses. Source of the proxy lives in `apps/website/src/app/api/ingest/`. ## Verifying telemetry is silent diff --git a/libs/telemetry/src/node/client.spec.ts b/libs/telemetry/src/node/client.spec.ts index ea155064e..432403a65 100644 --- a/libs/telemetry/src/node/client.spec.ts +++ b/libs/telemetry/src/node/client.spec.ts @@ -56,6 +56,12 @@ describe('node client', () => { expect(fetchMock.mock.calls[0][0]).toBe('https://custom.example/api/ingest'); }); + test('capturePostinstall defaults to the live Cacheplane ingest proxy', async () => { + delete process.env.NGAF_TELEMETRY_INGEST_URL; + await capturePostinstall({ pkg: 'x', version: '1' }); + expect(fetchMock.mock.calls[0][0]).toBe('https://cacheplane.ai/api/ingest'); + }); + test('capturePostinstall sends sample_weight property', async () => { await capturePostinstall({ pkg: 'x', version: '1' }); const body = JSON.parse(String(fetchMock.mock.calls[0][1].body)); diff --git a/libs/telemetry/src/node/client.ts b/libs/telemetry/src/node/client.ts index 8db7530c8..f379695b0 100644 --- a/libs/telemetry/src/node/client.ts +++ b/libs/telemetry/src/node/client.ts @@ -4,7 +4,7 @@ import { shouldSample } from '../shared/sample.js'; import type { NgafNodeEvent } from '../shared/events.js'; import { isProgrammaticallyDisabled } from './disable.js'; -const DEFAULT_INGEST = 'https://cacheplane.dev/api/ingest'; +const DEFAULT_INGEST = 'https://cacheplane.ai/api/ingest'; const REQUEST_TIMEOUT_MS = 3_000; // Public identifier accepted by the Cacheplane ingest proxy. The proxy re-keys // server-side with the private PostHog token.