foglamp(config?) accepts the options below. Every field is optional. The v4
to v6 entry point takes the same options: wrap(ai, config) accepts them all,
plus a context for defaults (see wrap).
How often batches are sent on long-running servers.
maxBatchTraces
number
50
Send early once this many traces are buffered.
maxBatchSpans
number
500
Send early once this many spans are buffered.
maxQueuedSpans
number
5000
Max spans held in memory (for example when ingest is unreachable). Past it, the oldest traces are dropped and onError fires.
maxTraceAgeMs
number
600_000
A trace still open after this long (10 minutes) is closed as abandoned and counted as an error, so a crashed generation can’t leak spans. A cleanly cancelled stream is handled right away instead, via the aborted status.
maxPayloadChars
number
100_000
Max length for each input/output field. Longer values are cut off.
recordInputs
boolean
true
Capture prompt text.
recordOutputs
boolean
true
Capture response text.
recordSystemPrompt
boolean
true
Capture the system prompt (system, or an agent’s instructions) on the run. It powers the System prompt section and prompt versions. Also off when recordInputs is off.
waitUntil
function
none
Serverless flush hook. Detected automatically on Vercel and Lambda; pass ctx.waitUntil on Cloudflare Workers. See Runtimes.
fetch
function
global fetch
Custom fetch implementation.
debug
boolean
false
Log batching and flush activity.
onError
function
none
Called on transport or serialization errors instead of throwing.
The ingest API caps any single input or output field at 1,000,000
characters. maxPayloadChars (default 100,000) cuts off earlier to keep
payloads small. Raise it only if you need fuller logs. Values above 1,000,000
are clamped to that cap.
Privacy: keeping text out
To record traces, cost, and timing without ever sending prompt or response
text, turn capture off:
const fog = foglamp({ recordInputs: false, recordOutputs: false,});
Token counts and cost still work. They come from the provider’s usage report,
not from the text.To keep the conversation but drop only the system prompt (for example when it
embeds proprietary instructions), set recordSystemPrompt: false. Generation
settings (temperature, max output tokens, …) and provider warnings are always
recorded as span metadata; they contain no prompt text.
Error handling
The collector never throws into your app. Failures go to onError if you
provide one, and are otherwise ignored. Turn on debug to watch batching and
flushing during development.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Foglamp","description":"The missing observability layer for AI agents. Costs, latency, tokens, distributed traces, evals, and alerts for every model call - in two lines.","colors":{"primary":"#171717","light":"#FFFFFF","dark":"#171717"},"logo":{"light":"https://mintcdn.com/watchtower-26995943/1sml0kwCw1BNtiz-/images/Frame@2x(2).png?fit=max\u0026auto=format\u0026n=1sml0kwCw1BNtiz-\u0026q=85\u0026s=a7c846a133aa3480dc1e03a2da5fec2b","dark":"https://mintcdn.com/watchtower-26995943/1sml0kwCw1BNtiz-/images/Frame@2x(1).png?fit=max\u0026auto=format\u0026n=1sml0kwCw1BNtiz-\u0026q=85\u0026s=6534218552b79980770f11c40aafd6ec"},"favicon":{"light":"https://mintcdn.com/watchtower-26995943/HBjQlX3rbPIDdyKV/images/icon.png?fit=max\u0026auto=format\u0026n=HBjQlX3rbPIDdyKV\u0026q=85\u0026s=348a0d005fa67b1d7d9ab250780c5021","dark":"https://mintcdn.com/watchtower-26995943/HBjQlX3rbPIDdyKV/images/icon.png?fit=max\u0026auto=format\u0026n=HBjQlX3rbPIDdyKV\u0026q=85\u0026s=348a0d005fa67b1d7d9ab250780c5021"},"background":{"color":{"light":"#FAFAFA","dark":"#0F0F0F"}},"navbar":{"links":[],"primary":{"type":"github","href":"https://github.com/foglamp-labs/foglamp"}},"footer":{"socials":{"github":"https://github.com/foglamp-labs/foglamp"}},"seo":{"indexing":"navigable"},"fonts":{"family":"Inter"},"icons":{"library":"tabler"},"integrations":{"posthog":{"apiKey":"phc_omfZbJqrCPpUndrTXtruEZvMZqde6Vqq8yP4dK6oJbzZ","apiHost":"https://us.i.posthog.com","sessionRecording":true}},"contextual":{"options":["copy","assistant","view","chatgpt","claude","cursor"],"display":"header"},"thumbnails":{"fonts":{"family":"Inter"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"watchtower-26995943","hasAudioNarration":false,"actualSubdomain":"watchtower-26995943","customDomains":["docs.foglamp.dev"],"gitSource":{"type":"github","owner":"foglamp-labs","repo":"foglamp","deployBranch":"master","contentDirectory":"docs","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"agentFeedback":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6adb787429f87a0e412d81fc","clientVersion":"0.0.4336","searchFilterCounts":[{"language":"default","tag":"Documentation","count":10},{"language":"default","tag":"Dashboard","count":9},{"language":"default","tag":"Explore","count":5},{"language":"default","tag":"SDK","count":5},{"language":"default","tag":"Get started","count":4},{"language":"default","tag":"API reference","count":4},{"language":"default","tag":"Operate","count":4},{"language":"default","tag":"Self-hosting","count":4},{"language":"default","tag":"Ingest","count":2},{"language":"default","tag":"Changelog","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"sdk/configuration","slug":"/sdk/configuration","pageMetadata":{"title":"Configuration","description":"Every option accepted by foglamp().","href":"/sdk/configuration"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Every option accepted by foglamp().\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[_jsx(_components.code,{children:`foglamp(config?)`}),` accepts the options below. Every field is optional. The v4\nto v6 entry point takes the same options: `,_jsx(_components.code,{children:`wrap(ai, config)`}),` accepts them all,\nplus a `,_jsx(_components.code,{children:`context`}),` for defaults (see `,_jsx(_components.a,{href:`/sdk/wrap`,children:`wrap`}),`).`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fog = foglamp({`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` apiKey: process.env.FOGLAMP_API_KEY,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` endpoint: process.env.FOGLAMP_INGEST_URL,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` flushIntervalMs: 5000,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` maxBatchTraces: 50,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` maxBatchSpans: 500,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` maxPayloadChars: 100_000,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` recordInputs: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` recordOutputs: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` recordSystemPrompt: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`true`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` debug: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` onError: (err) => console.error(err),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`options`,children:`Options`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Option`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Default`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`apiKey`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`FOGLAMP_API_KEY`})}),_jsxs(_components.td,{children:[`Your `,_jsx(_components.code,{children:`fl_...`}),` key. If unset, the collector is off.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`endpoint`})}),_jsx(_components.td,{children:`string`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`https://ingest.foglamp.dev/ingest`})}),_jsx(_components.td,{children:`Where to send data. Set this when self-hosting.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`flushIntervalMs`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`5000`})}),_jsx(_components.td,{children:`How often batches are sent on long-running servers.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxBatchTraces`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`50`})}),_jsx(_components.td,{children:`Send early once this many traces are buffered.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxBatchSpans`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`500`})}),_jsx(_components.td,{children:`Send early once this many spans are buffered.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxQueuedSpans`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`5000`})}),_jsxs(_components.td,{children:[`Max spans held in memory (for example when ingest is unreachable). Past it, the oldest traces are dropped and `,_jsx(_components.code,{children:`onError`}),` fires.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxTraceAgeMs`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`600_000`})}),_jsxs(_components.td,{children:[`A trace still open after this long (10 minutes) is closed as `,_jsx(_components.code,{children:`abandoned`}),` and counted as an error, so a crashed generation can’t leak spans. A cleanly cancelled stream is handled right away instead, via the `,_jsxs(_components.a,{href:`/dashboard/traces`,children:[_jsx(_components.code,{children:`aborted`}),` status`]}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`maxPayloadChars`})}),_jsx(_components.td,{children:`number`}),_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`100_000`})}),_jsxs(_components.td,{children:[`Max length for each `,_jsx(_components.code,{children:`input`}),`/`,_jsx(_components.code,{children:`output`}),` field. Longer values are cut off.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`recordInputs`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`true`})}),_jsx(_components.td,{children:`Capture prompt text.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`recordOutputs`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`true`})}),_jsx(_components.td,{children:`Capture response text.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`recordSystemPrompt`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`true`})}),_jsxs(_components.td,{children:[`Capture the system prompt (`,_jsx(_components.code,{children:`system`}),`, or an agent’s `,_jsx(_components.code,{children:`instructions`}),`) on the run. It powers the `,_jsx(_components.strong,{children:`System prompt`}),` section and `,_jsx(_components.a,{href:`/dashboard/agents#prompt-versions`,children:`prompt versions`}),`. Also off when `,_jsx(_components.code,{children:`recordInputs`}),` is off.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`waitUntil`})}),_jsx(_components.td,{children:`function`}),_jsx(_components.td,{children:`none`}),_jsxs(_components.td,{children:[`Serverless flush hook. Detected automatically on Vercel and Lambda; pass `,_jsx(_components.code,{children:`ctx.waitUntil`}),` on Cloudflare Workers. See `,_jsx(_components.a,{href:`/sdk/runtimes`,children:`Runtimes`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`fetch`})}),_jsx(_components.td,{children:`function`}),_jsxs(_components.td,{children:[`global `,_jsx(_components.code,{children:`fetch`})]}),_jsx(_components.td,{children:`Custom fetch implementation.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`debug`})}),_jsx(_components.td,{children:`boolean`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`false`})}),_jsx(_components.td,{children:`Log batching and flush activity.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`onError`})}),_jsx(_components.td,{children:`function`}),_jsx(_components.td,{children:`none`}),_jsx(_components.td,{children:`Called on transport or serialization errors instead of throwing.`})]})]})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`The ingest API caps any single `,_jsx(_components.code,{children:`input`}),` or `,_jsx(_components.code,{children:`output`}),` field at 1,000,000\ncharacters. `,_jsx(_components.code,{children:`maxPayloadChars`}),` (default 100,000) cuts off earlier to keep\npayloads small. Raise it only if you need fuller logs. Values above 1,000,000\nare clamped to that cap.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`privacy-keeping-text-out`,children:`Privacy: keeping text out`}),`\n`,_jsx(_components.p,{children:`To record traces, cost, and timing without ever sending prompt or response\ntext, turn capture off:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fog = foglamp({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` recordInputs: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` recordOutputs: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Token counts and cost still work. They come from the provider’s usage report,\nnot from the text.`}),`\n`,_jsxs(_components.p,{children:[`To keep the conversation but drop only the system prompt (for example when it\nembeds proprietary instructions), set `,_jsx(_components.code,{children:`recordSystemPrompt: false`}),`. Generation\nsettings (temperature, max output tokens, …) and provider warnings are always\nrecorded as span metadata; they contain no prompt text.`]}),`\n`,_jsx(Heading,{level:`2`,id:`error-handling`,children:`Error handling`}),`\n`,_jsxs(_components.p,{children:[`The collector never throws into your app. Failures go to `,_jsx(_components.code,{children:`onError`}),` if you\nprovide one, and are otherwise ignored. Turn on `,_jsx(_components.code,{children:`debug`}),` to watch batching and\nflushing during development.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` fog = foglamp({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` debug: process.env.NODE_ENV !== `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"production\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` onError: (err) => reportToSentry(err),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Configuration","description":"Every option accepted by foglamp().","href":"/sdk/configuration"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Options","slug":"options","depth":2,"children":[]},{"title":"Privacy: keeping text out","slug":"privacy-keeping-text-out","depth":2,"children":[]},{"title":"Error handling","slug":"error-handling","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"watchtower-26995943","siteName":"Foglamp","title":"Configuration - Foglamp","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-02T23:46:41.876Z","originalFileLocation":"sdk/configuration.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Every option accepted by foglamp().\">\u003cmeta data-mint-head name=\"application-name\" content=\"Foglamp\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Configuration - Foglamp\">\u003cmeta data-mint-head property=\"og:description\" content=\"Every option accepted by foglamp().\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Foglamp\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.foglamp.dev/sdk/configuration\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://watchtower-26995943.mintlify.site/_mintlify/api/og/v2?division=SDK\u0026amp;title=Configuration\u0026amp;description=Every+option+accepted+by+foglamp%28%29.\u0026amp;theme=9bea389c6d8205516e235640\u0026amp;signature=4f095c111184e0a2a7716f16ad6053d4e4292967805e74b2b4aa4d3b10b4b614\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Configuration - Foglamp\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Every option accepted by foglamp().\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://watchtower-26995943.mintlify.site/_mintlify/api/og/v2?division=SDK\u0026amp;title=Configuration\u0026amp;description=Every+option+accepted+by+foglamp%28%29.\u0026amp;theme=9bea389c6d8205516e235640\u0026amp;signature=4f095c111184e0a2a7716f16ad6053d4e4292967805e74b2b4aa4d3b10b4b614\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/watchtower-26995943/Nsm3YsrkmNDj6QwR/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Foglamp\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#171717\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.foglamp.dev/sdk/configuration\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/sdk/configuration.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.foglamp.dev/#organization\",\"name\":\"Foglamp\",\"url\":\"https://docs.foglamp.dev\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/watchtower-26995943/1sml0kwCw1BNtiz-/images/Frame@2x(2).png?fit=max\u0026auto=format\u0026n=1sml0kwCw1BNtiz-\u0026q=85\u0026s=a7c846a133aa3480dc1e03a2da5fec2b\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.foglamp.dev#website\",\"name\":\"Foglamp\",\"url\":\"https://docs.foglamp.dev\",\"publisher\":{\"@id\":\"https://docs.foglamp.dev/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.foglamp.dev/sdk/configuration#webpage\",\"url\":\"https://docs.foglamp.dev/sdk/configuration\",\"name\":\"Configuration\",\"description\":\"Every option accepted by foglamp().\",\"dateModified\":\"2026-09-02T23:46:41.876Z\",\"isPartOf\":{\"@id\":\"https://docs.foglamp.dev#website\"},\"breadcrumb\":{\"@id\":\"https://docs.foglamp.dev/sdk/configuration#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.foglamp.dev/sdk/configuration#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SDK\",\"item\":\"https://docs.foglamp.dev/sdk/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Configuration\",\"item\":\"https://docs.foglamp.dev/sdk/configuration\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.foglamp.dev/sdk/configuration#article\",\"headline\":\"Configuration\",\"name\":\"Configuration\",\"description\":\"Every option accepted by foglamp().\",\"url\":\"https://docs.foglamp.dev/sdk/configuration\",\"mainEntityOfPage\":{\"@id\":\"https://docs.foglamp.dev/sdk/configuration#webpage\"},\"dateModified\":\"2026-09-02T23:46:41.876Z\",\"publisher\":{\"@id\":\"https://docs.foglamp.dev/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.foglamp.dev#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Foglamp\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Foglamp\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/sdk/configuration.md","siteName":"Foglamp","nav":{"global":null,"tabs":[{"tab":"Documentation","groups":[{"group":"Get started","pages":[{"title":"Introduction","href":"/introduction"},{"title":"Quickstart","href":"/quickstart"},{"title":"Instrument with an AI agent","href":"/ai-instrument"},{"title":"Troubleshooting","href":"/troubleshooting"}]},{"group":"Core concepts","pages":[{"title":"Data model","href":"/concepts/data-model"}]},{"group":"SDK","pages":[{"title":"SDK overview","description":"The foglamp() collector and its integration methods.","href":"/sdk/overview"},{"title":"Configuration","href":"/sdk/configuration"},{"title":"Runtimes \u0026 flushing","description":"Make sure spans leave the process in every runtime.","href":"/sdk/runtimes"},{"title":"AI SDK v4 to v6 (wrap)","href":"/sdk/wrap"},{"title":"Live HUD","href":"/sdk/hud"}]}]},{"tab":"Dashboard","pages":[{"title":"Dashboard","href":"/dashboard/overview"}]},{"tab":"Self-hosting","pages":[{"title":"Self-hosting","href":"/self-hosting/overview"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog"}]},{"tab":"API reference","pages":[{"title":"API reference","href":"/api-reference/introduction"}]}]},"basePath":"","title":"Configuration - Foglamp","deploymentId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","buildId":"dpl_9bQLTw9nc2h9csDGYcKwWenPcQWn","dynamics":[],"chunks":[]}