fix(memory): Skip same-service parents when building dependency links - #9090
Open
lopster568 wants to merge 1 commit into
Open
fix(memory): Skip same-service parents when building dependency links#9090lopster568 wants to merge 1 commit into
lopster568 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes the v2 in-memory dependency graph behavior to align with other Jaeger backends by skipping dependency links where the parent and child spans resolve to the same service (avoiding service -> service self-loops), addressing #9089.
Changes:
- Skip dependency-link creation when
parentSpanServiceName == spanServiceNameingetDependencies. - Add
TestGetDependencies_SameServiceto ensure same-service parent/child spans do not produce a self-dependency while cross-service relationships still do.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/storage/v2/memory/tenant.go | Adds a guard to drop same-service parent/child dependency links during dependency extraction. |
| internal/storage/v2/memory/memory_test.go | Adds a regression test covering same-service parent/child spans plus a cross-service call. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9090 +/- ##
=======================================
Coverage 97.43% 97.43%
=======================================
Files 377 377
Lines 19625 19625
=======================================
Hits 19121 19121
Misses 369 369
Partials 135 135
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The v2 in-memory store did not check whether a span's parent belonged to the same service, so any service with nested internal spans produced a service -> service self-loop in the System Architecture graph. Memory is the default all-in-one backend, so this is the common local experience. Both sibling implementations already skip these: the Badger dependency store (whose comment notes it was copied from the memory plugin) and the v1 in-memory store before it was removed. Signed-off-by: Roshan <rosh.s568@gmail.com>
lopster568
force-pushed
the
fix/memory-self-dependency-links
branch
from
July 23, 2026 13:39
712c700 to
092b7fc
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.
Which problem is this PR solving?
Description of the changes
Skip dependency links where the parent and child span belong to the same service, matching the Badger dependency store and the v1 memory store this code was ported from.
How was this change tested?
TestGetDependencies_SameService: one trace with an internal parent/child pair inservice-xplus a cross-service call toservice-y, asserting onlyservice-x -> service-yis returned. Onmainit also returnsservice-x -> service-x.TestGetDependencies*cases are unaffected.Note: #8767 and #9003 also have open changes to
getDependencies. Happy to rebase behind whichever lands first.Checklist
make lint testAI Usage in this PR (choose one)
See AI Usage Policy.