Skip to content

docs(sdk): document the overrides argument for capturing telemetry in tests - #197

Merged
aikins01 merged 1 commit into
mainfrom
docs/sdk/document-overrides
Nov 4, 2026
Merged

aikins01 merged 1 commit into
mainfrom
docs/sdk/document-overrides

Conversation

@aikins01

@aikins01 aikins01 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

The second argument of telemetryDev() in ai-sdk and tanstack-ai replaces span export and metric recording. Both packages' tests capture through it, and #83 asked whether it should stay. It stays, so this documents it as the way to capture telemetry in tests.

Each README gets a Testing section with an example. It spells out the two things a caller would otherwise trip on: the integration still needs a non-empty API key or it does nothing, and a function left out keeps exporting to telemetry.dev, so a test needs all three to stay offline. The doc comment on GenerationEmitterOverrides in @telemetry-dev/otel states the same contract, and the test comments that called it a test seam are gone.

I ran the README examples against a real generateText and a real chat() with fetch stubbed: spans and token counts were captured and nothing was posted. With only sendSpans passed, metrics still went to /v1/metrics.

Refs #83

@aikins01 aikins01 self-assigned this Nov 4, 2026
@aikins01
aikins01 merged commit 49dcd2c into main Nov 4, 2026
10 checks passed
@aikins01
aikins01 deleted the docs/sdk/document-overrides branch November 4, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant