Skip to content

feat(ai): create a diagnostics channel to push event data#14854

Merged
aayush-kapoor merged 5 commits intomainfrom
aayush/diagnostic-channels
Apr 30, 2026
Merged

feat(ai): create a diagnostics channel to push event data#14854
aayush-kapoor merged 5 commits intomainfrom
aayush/diagnostic-channels

Conversation

@aayush-kapoor
Copy link
Copy Markdown
Collaborator

@aayush-kapoor aayush-kapoor commented Apr 30, 2026

Background

Diagnostics channels are a way to relay event data and it works on a publisher/subscriber mechanism.

Some o11y providers had a request from us to emit the event data for telemetry through diagnostics channels instead of the callbacks

Summary

the telemetry dispatcher now also publishes the same augmented lifecycle event to the diagnostics channel named aisdk:telemetry

Manual Verification

ran the example examples/ai-functions/src/telemetry/diagnostic-channel/generate-text.ts

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Comment thread packages/ai/src/telemetry/diagnostic-channel-publisher.ts Outdated
@@ -0,0 +1,24 @@
export const AI_SDK_TELEMETRY_DIAGNOSTIC_CHANNEL = 'ai.telemetry';

export type TelemetryDiagnosticEventType =
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these typical names for diagnostics channel events? how is the diagnostics channel used by other projects?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will check

Copy link
Copy Markdown
Collaborator Author

@aayush-kapoor aayush-kapoor Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made a minor change with the channel name, now aisdk:telemetry - aligns with channel nomenclature for diagnostic channel.

as for the message types, we can define those to be wtv we want. this way they align with the callback names

Comment thread packages/ai/src/telemetry/diagnostic-channel-publisher.ts Outdated
Comment thread packages/ai/src/telemetry/create-telemetry-dispatcher.ts
@aayush-kapoor aayush-kapoor merged commit 202f107 into main Apr 30, 2026
18 checks passed
@aayush-kapoor aayush-kapoor deleted the aayush/diagnostic-channels branch April 30, 2026 18:11
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
ai 7.0.0-beta.115
@ai-sdk/alibaba 2.0.0-beta.37
@ai-sdk/amazon-bedrock 5.0.0-beta.46
@ai-sdk/angular 3.0.0-beta.115
@ai-sdk/anthropic 4.0.0-beta.42
@ai-sdk/assemblyai 3.0.0-beta.32
@ai-sdk/azure 4.0.0-beta.42
@ai-sdk/baseten 2.0.0-beta.35
@ai-sdk/black-forest-labs 2.0.0-beta.31
@ai-sdk/bytedance 2.0.0-beta.32
@ai-sdk/cerebras 3.0.0-beta.35
@ai-sdk/cohere 4.0.0-beta.32
@ai-sdk/deepgram 3.0.0-beta.31
@ai-sdk/deepinfra 3.0.0-beta.35
@ai-sdk/deepseek 3.0.0-beta.33
@ai-sdk/elevenlabs 3.0.0-beta.31
@ai-sdk/fal 3.0.0-beta.31
@ai-sdk/fireworks 3.0.0-beta.35
@ai-sdk/gateway 4.0.0-beta.66
@ai-sdk/gladia 3.0.0-beta.31
@ai-sdk/google 4.0.0-beta.49
@ai-sdk/google-vertex 5.0.0-beta.63
@ai-sdk/groq 4.0.0-beta.34
@ai-sdk/huggingface 2.0.0-beta.35
@ai-sdk/hume 3.0.0-beta.31
@ai-sdk/klingai 4.0.0-beta.32
@ai-sdk/langchain 3.0.0-beta.115
@ai-sdk/llamaindex 3.0.0-beta.115
@ai-sdk/lmnt 3.0.0-beta.31
@ai-sdk/luma 3.0.0-beta.31
@ai-sdk/mcp 2.0.0-beta.37
@ai-sdk/mistral 4.0.0-beta.33
@ai-sdk/moonshotai 3.0.0-beta.35
@ai-sdk/open-responses 2.0.0-beta.33
@ai-sdk/openai 4.0.0-beta.42
@ai-sdk/openai-compatible 3.0.0-beta.35
@ai-sdk/otel 1.0.0-beta.61
@ai-sdk/perplexity 4.0.0-beta.34
@ai-sdk/prodia 2.0.0-beta.34
@ai-sdk/provider-utils 5.0.0-beta.30
@ai-sdk/react 4.0.0-beta.115
@ai-sdk/replicate 3.0.0-beta.32
@ai-sdk/revai 3.0.0-beta.32
@ai-sdk/rsc 3.0.0-beta.116
@ai-sdk/svelte 5.0.0-beta.115
@ai-sdk/togetherai 3.0.0-beta.35
@ai-sdk/valibot 3.0.0-beta.30
@ai-sdk/vercel 3.0.0-beta.35
@ai-sdk/voyage 1.0.0-beta.4
@ai-sdk/vue 4.0.0-beta.115
@ai-sdk/workflow 1.0.0-beta.30
@ai-sdk/xai 4.0.0-beta.48

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.

2 participants