Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carry both call-site and definition site in Effect.fn, auto-trace to anon #4155

Merged
merged 4 commits into from
Dec 18, 2024

Conversation

mikearnaldi
Copy link
Member

The following code:

import { Cause, Effect, Exit } from "effect"

const f = () => {
  throw new Error("OOO")
}

const program = Effect.fn(function*() {
  f()
})

Effect.runPromiseExit(Effect.scoped(program())).then(Exit.match({
  onSuccess() {},
  onFailure(cause) {
    console.log(Cause.pretty(cause))
  }
}))

will print:

Error: OOO
    at f (/Users/michaelarnaldi/repositories/effect/scratchpad/exit.ts:4:9)
    at <anonymous> (/Users/michaelarnaldi/repositories/effect/scratchpad/exit.ts:8:3)
    at <anonymous> (/Users/michaelarnaldi/repositories/effect/scratchpad/exit.ts:7:24)
    at <anonymous> (/Users/michaelarnaldi/repositories/effect/scratchpad/exit.ts:11:37)

@mikearnaldi
Copy link
Member Author

@tim-smart proposal to auto-trace, this should follow the introduction to the flag to avoid propagation of anon spans.

Note that while spans shouldn't be propagated the stack trace of an eventual error should still be complete even in otel, but that should work out of the box as it gets generated via pretty

Copy link

changeset-bot bot commented Dec 17, 2024

🦋 Changeset detected

Latest commit: 4735117

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 35 packages
Name Type
effect Minor
@effect/vitest Major
@effect/cli Major
@effect/cluster-browser Major
@effect/cluster-node Major
@effect/cluster-workflow Major
@effect/cluster Major
@effect/experimental Major
@effect/opentelemetry Major
@effect/platform-browser Major
@effect/platform-bun Major
@effect/platform-node-shared Major
@effect/platform-node Major
@effect/platform Major
@effect/printer-ansi Major
@effect/printer Major
@effect/rpc-http Major
@effect/rpc Major
@effect/sql-clickhouse Major
@effect/sql-d1 Major
@effect/sql-drizzle Major
@effect/sql-kysely Major
@effect/sql-libsql Major
@effect/sql-mssql Major
@effect/sql-mysql2 Major
@effect/sql-pg Major
@effect/sql-sqlite-bun Major
@effect/sql-sqlite-do Major
@effect/sql-sqlite-node Major
@effect/sql-sqlite-react-native Major
@effect/sql-sqlite-wasm Major
@effect/sql Major
@effect/typeclass Major
@effect/ai Major
@effect/ai-openai Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mikearnaldi
Copy link
Member Author

/rebase

@github-actions github-actions bot force-pushed the feat/multi-trace-fn branch from 0d32de7 to 040aa59 Compare December 17, 2024 18:25
@github-actions github-actions bot force-pushed the next-minor branch 2 times, most recently from b258917 to e9049ea Compare December 18, 2024 00:51
@tim-smart
Copy link
Contributor

/rebase

@tim-smart
Copy link
Contributor

/rebase

@tim-smart
Copy link
Contributor

/rebase

@tim-smart
Copy link
Contributor

/rebase

@tim-smart
Copy link
Contributor

/rebase

@effect-bot effect-bot force-pushed the next-minor branch 2 times, most recently from c90c7f4 to 6a5f5ec Compare December 18, 2024 10:50
@mikearnaldi
Copy link
Member Author

/rebase

effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 18, 2024
effect-bot pushed a commit that referenced this pull request Dec 19, 2024
effect-bot pushed a commit that referenced this pull request Dec 19, 2024
effect-bot pushed a commit that referenced this pull request Dec 20, 2024
effect-bot pushed a commit that referenced this pull request Dec 21, 2024
effect-bot pushed a commit that referenced this pull request Dec 21, 2024
effect-bot pushed a commit that referenced this pull request Dec 21, 2024
effect-bot pushed a commit that referenced this pull request Dec 21, 2024
effect-bot pushed a commit that referenced this pull request Dec 22, 2024
tim-smart added a commit that referenced this pull request Dec 22, 2024
tim-smart added a commit that referenced this pull request Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants