Skip to content

Auto-instrumentation for TypeScript#1302

Open
Qard wants to merge 1 commit intomainfrom
stephen/auto-instrumentation
Open

Auto-instrumentation for TypeScript#1302
Qard wants to merge 1 commit intomainfrom
stephen/auto-instrumentation

Conversation

@Qard
Copy link

@Qard Qard commented Jan 23, 2026

Uses orchestrion together with AsyncLocalStorage and diagnostics_channel (or als-browser and dc-browser) to provide fully decoupled instrumentation via definitions and diagnostics_channel consumer plugins. Also supports bundlers including vite, webpack, esbuild, and rollup.

So far this just adds the infrastructure for the capturing side of the diagnostics_channel model, and some types for the plugin side, but it's not yet set up to actually enable the plugins yet to transform the events into spans. The model is there though for people to see how it would work.

@Qard Qard self-assigned this Jan 23, 2026
@Qard Qard added enhancement New feature or request javascript Pull requests that update javascript code lang:js labels Jan 23, 2026
@Qard Qard force-pushed the stephen/auto-instrumentation branch 9 times, most recently from ddf8d8f to 256806c Compare January 27, 2026 10:07
@Qard Qard marked this pull request as ready for review January 27, 2026 10:07
@Qard Qard force-pushed the stephen/auto-instrumentation branch 9 times, most recently from e37a8b1 to c5af6af Compare January 27, 2026 13:03
@Qard Qard force-pushed the stephen/auto-instrumentation branch 4 times, most recently from 0e1ebb5 to a2e79fe Compare February 3, 2026 16:17
@Qard Qard force-pushed the stephen/auto-instrumentation branch 10 times, most recently from 9988e20 to be9631d Compare February 6, 2026 06:57
Uses orchestrion together with AsyncLocalStorage and
diagnostics_channel (or als-browser and dc-browser) to
provide fully decoupled instrumentation via definitions
and diagnostics_channel consumer plugins. Also supports
bundlers including vite, webpack, esbuild, and rollup.
@Qard Qard force-pushed the stephen/auto-instrumentation branch from be9631d to 460a7c1 Compare February 6, 2026 06:58
Copy link
Contributor

@cpinn cpinn left a comment

Choose a reason for hiding this comment

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

Haven't made it through all the files yet but these were some of the questions I had while looking over the change. Mainly related to packaging and dependencies and whether this is meant to be a separate package or not.

* will prepend "orchestrion:ai-sdk:" to these names, resulting in final channel names like:
* "orchestrion:ai-sdk:generateText"
*/
export const aiSDKConfigs: InstrumentationConfig[] = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Originally had a question about if tool calls were being instrumented but looks like yes after I saw the plugin tests. Is that correct the tool calls will still be traced?

"@types/nunjucks": "^3.2.6",
"@vercel/functions": "^1.0.2",
"ajv": "^8.17.1",
"als-browser": "^1.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

If we split the browser build into its own package like we were planning to, would we need als-browser and dc-browser in the main package?

clean: true,
},
{
entry: ["src/instrumentation/index.ts"],
Copy link
Contributor

Choose a reason for hiding this comment

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

What is more common auto instrumentation in the main package or a different package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request javascript Pull requests that update javascript code lang:js

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants