[Go] Prevent genkit:isFailureSource attribute from propagating to parent spans
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- go
- Domain
- observability
Research direction
Start in go/core/tracing/tracing.go and compare the error-handling flow with the ignoreFailedSpan logic in js/core/src/tracing/instrumentation.ts. Trace how errors move through nested spans and verify that only the deepest span receives genkit:isFailureSource, while parent spans recognize the marked error. Done means a single failure is not counted repeatedly along the call stack.
Written by the indexing model from the issue text.
Description
The Go implementation of Genkit instrumentation incorrectly marks every span in a failing call stack with the genkit:isFailureSource attribute. This attribute should only be set on the original (deepest) span where the error occurred.
Current Behavior (Go)
In go/core/tracing/tracing.go, the code sets sm.IsFailureSource = true whenever an error is returned, without checking if the error has already been "marked" by a child span. This leads to redundant marking as the error bubbles up.
Reference Behavior (JS)
The JavaScript implementation in js/core/src/tracing/instrumentation.ts correctly uses a flag (ignoreFailedSpan) to ensure isFailureSource is only set once at the origin.
Impact
- Metrics Inaccuracy: Monitoring systems that aggregate failure counts based on the
isFailureSourceattribute will overcount a single failure multiple times (once for every span in the path). - UI Visualization: The Genkit Developer UI may fail to highlight the specific root cause correctly if multiple spans claim to be the source.
Proposed Solution
Update the error handling in go/core/tracing/tracing.go to only set sm.IsFailureSource = true if !isErrorAlreadyMarked(err). The error should then be wrapped using markErrorAsHandled(err) to ensure parents correctly identify it as already processed.
- Dominant language
- TypeScript
- Stars
- 6.5k
- Forks
- 845
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 56
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from genkit-ai/genkit
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
python
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
python
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
All issues in genkit-ai/genkit
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100