Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion libs/telemetry/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions libs/telemetry/src/node/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion libs/telemetry/src/node/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading