docs: add Temporal TypeScript tracing example#3273
Open
ofeliacode wants to merge 1 commit into
Open
Conversation
|
Someone is attempting to deploy a commit to the langfuse Team on Vercel. A member of the Team first needs to authorize it. |
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
ofeliacode
force-pushed
the
docs-temporal-js-example
branch
from
July 14, 2026 19:27
f5b955e to
ca7940b
Compare
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.
What does this PR do?
Closes #3248
Adds a TypeScript/JavaScript example to the Temporal integration guide showing how to trace Temporal workflows and activities with:
The source notebook and generated MDX page are both updated.
Test plan
git diff --checknpm exec --yes prettier -- --check content/integrations/frameworks/temporal.mdxnode -e "JSON.parse(require('fs').readFileSync('cookbook/integration_temporal.ipynb','utf8')); console.log('notebook json ok')"node scripts/check-h1-headings.js content/integrations/frameworks/temporal.mdxGreptile Summary
This PR adds a TypeScript/JavaScript tracing example to the Temporal integration guide, showing how to configure
OpenTelemetryPluginfrom@temporalio/interceptors-opentelemetry-v2alongsideLangfuseSpanProcessorto capture Temporal workflow and activity spans.instrumentation.ts,worker.ts,client.ts) demonstrating plugin setup for both the Temporal worker and client; the package and API usage (OpenTelemetryPlugin,Worker.create({ plugins }),Client({ plugins })) are all valid and consistent with current Temporal SDK docs.pluginsAPI onWorkerandClientis marked experimental in the Temporal TypeScript SDK; a brief note would set reader expectations.Confidence Score: 4/5
Safe to merge; the TypeScript code is correct and the packages referenced are official and exist on npm.
The code samples are technically accurate —
OpenTelemetryPluginis a real export, bothWorker.createandClientacceptplugins, and theLangfuseSpanProcessorwiring is consistent with Langfuse's own getting-started docs. The only concerns are editorial: section placement interrupts the numbered Python tutorial, and the experimental status ofpluginsis not disclosed. No functional bugs were found.The placement of the TypeScript section within
temporal.mdx(between steps 7 and 8) is the main thing worth a second look before merging.Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant C as client.ts (Temporal Client) participant T as Temporal Server participant W as worker.ts (Temporal Worker) participant OTel as NodeSDK + OpenTelemetryPlugin participant LF as Langfuse (via LangfuseSpanProcessor) C->>OTel: setupOtelSdk() – registers LangfuseSpanProcessor globally C->>C: "new Client({ plugins: [OpenTelemetryPlugin] })" C->>T: client.workflow.execute(ResearchWorkflow) + W3C trace context T->>W: dispatches workflow task (with propagated trace context) W->>OTel: setupOtelSdk() – registers LangfuseSpanProcessor (separate process) W->>W: "new Worker({ plugins: [OpenTelemetryPlugin] })" W->>W: executes workflow and activities W->>OTel: workflow/activity spans emitted OTel->>LF: exports spans via LangfuseSpanProcessor C->>OTel: client span exported on workflow completion OTel->>LF: exports client span%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant C as client.ts (Temporal Client) participant T as Temporal Server participant W as worker.ts (Temporal Worker) participant OTel as NodeSDK + OpenTelemetryPlugin participant LF as Langfuse (via LangfuseSpanProcessor) C->>OTel: setupOtelSdk() – registers LangfuseSpanProcessor globally C->>C: "new Client({ plugins: [OpenTelemetryPlugin] })" C->>T: client.workflow.execute(ResearchWorkflow) + W3C trace context T->>W: dispatches workflow task (with propagated trace context) W->>OTel: setupOtelSdk() – registers LangfuseSpanProcessor (separate process) W->>W: "new Worker({ plugins: [OpenTelemetryPlugin] })" W->>W: executes workflow and activities W->>OTel: workflow/activity spans emitted OTel->>LF: exports spans via LangfuseSpanProcessor C->>OTel: client span exported on workflow completion OTel->>LF: exports client spanPrompt To Fix All With AI
Reviews (1): Last reviewed commit: "docs: add Temporal TypeScript tracing ex..." | Re-trigger Greptile