docs(reference): document the telemetry subsystem#146
Draft
tembo[bot] wants to merge 1 commit into
Draft
Conversation
Contributor
Author
|
Requesting review from @leoisadev1 who has experience with the following files modified in this PR:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PR #128 (docs humanize/rewrite) and #141 (PostHog telemetry) landed together. The telemetry subsystem is a substantial, privacy-relevant, user-facing feature, but it only exists in the two READMEs — the docs site (
apps/fumadocs/content/docs/**) has no page for it, and thetelemetryclient option was missing from the client reference entirely. This closes that gap. Docs-only; no source changes.Docs added/updated
reference/telemetry.mdx(added toreference/meta.jsonnav). Covers, verified against source:client created,email sent,email batch sent,cli command run), their notable properties, the environment fingerprint, thesdk/clisource tag, and the two "no user strings" rules (adapter-name normalization tocustom/unknown, recipient counts not recipients).EmailValidationError,EmailProviderNotFoundError), the message/stack/error-name redaction passes, and the per-process rate limits (5 exceptions, per-object/per-class dedupe, 3-link cause chain, 20 frames).~/.config/email-sdk/telemetry.json(honorsXDG_CONFIG_HOME), read-only-environment fallback.EMAIL_SDK_TELEMETRY=0,DO_NOT_TRACK=1,telemetry: falseclient option, and automaticNODE_ENV=test.reference/client.mdx— added the previously-undocumentedtelemetry?: booleanoption to thecreateEmailClientTypeTable and cross-linked it to the new page.Codepaths covered
packages/email-sdk/src/telemetry.ts— event/exception capture, redaction (redactErrorMessage,sanitizeFrameFilename,sanitizeErrorName), opt-out logic (isTelemetryDisabled), state file (loadTelemetryState/persistTelemetryState), delivery, dedupe/budget caps,normalizeAdapterName,isReportableSendError,detectCiVendor.packages/email-sdk/src/core.ts—client created/email sent/email batch sentcapture calls and their exact property sets, thetelemetry === falseopt-out, andcaptureExceptionon failed sends.packages/email-sdk/src/cli.ts—setTelemetrySource("cli"),cli command runcapture, andflush()before exit.packages/email-sdk/src/types.ts— thetelemetry?: booleanclient option.Key knowledge gaps addressed
telemetryclient option was undocumented in the client reference.Validation
bun run types:check(fumadocs-mdx + tsc) inapps/fumadocs: passes.bun run buildinapps/fumadocs: exit 0;/docs/reference/telemetry,#opting-out, and the client#createemailclientoptionscross-link all prerender.telemetry.ts,core.ts,cli.ts, andtypes.ts. Versioned archives (docs-v/**), routes, and generated files untouched.