Skip to content

Conversation

alvarosevilla95
Copy link

@alvarosevilla95 alvarosevilla95 commented Oct 8, 2025

Background

The reason to propose this is that currently I'm having a hard time getting telemetry to show up correctly in langfuse while using effect.

Because the stream returned by stream operations exists outside the lifecycle of the calling function, traces get reported out of order, and ultimately certain attributes that should be made available to the root span never make it.

So forcing the ai traces to be isolated isi the only way I've been able to sort of solve it.

Summary

Adds a new flag rootSpan to experimental_telemetry that instructs to create a root span (detached from any parent) during the execution. Defaults to false keeping the current behavior.

Manual Verification

Tested a local build with my existing app

Checklist

  • 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)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)
  • I have reviewed this pull request (self-review)

Future Work

Related Issues

Adds a new flag `rootSpan` to `experimental_telemetry` that instructs to
create a root span (detached from any parent) during the execution. Defaults
to false keeping the current behavior.

The reason to propose this is that currently I'm having a hard time
getting telemetry to show up correctly in langfuse while using effect.

Because the stream returned by stream operations exists outside the
lifecycle of the calling function, traces get reported out of order, and
ultimately certain attributes that should be made available to the root
span never make it.

So forcing the ai traces to be isolated isi the only way I've been able to
sort of solve it.
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