-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
SpanKind support for badger #6376
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Manik2708 <[email protected]>
I have changed the structure of cache which is leading to these concerns:
Once the correct approach is discussed I will handle some more edge cases and make the e2e tests pass (making |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6376 +/- ##
===========================================
- Coverage 96.22% 49.30% -46.93%
===========================================
Files 363 180 -183
Lines 20748 11257 -9491
===========================================
- Hits 19965 5550 -14415
- Misses 599 5257 +4658
- Partials 184 450 +266
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@yurishkuro Please review the approach and problems! |
Signed-off-by: Manik2708 <[email protected]>
Signed-off-by: Manik2708 <[email protected]>
@yurishkuro I have added more changes which reduces the iterations in prefill to 1 but it limits the |
I have an idea for old data without using the migration script! We can store the old data in two other data structures in cache (without kind). But then the only question which rises then: What to return when no span kind is given by user? Operations of new data of all kind or operations of old data (kind marked as unspecified) or an addition of both? |
@@ -18,7 +21,7 @@ type CacheStore struct { | |||
// Given the small amount of data these will store, we use the same structure as the memory store | |||
cacheLock sync.Mutex // write heavy - Mutex is faster than RWMutex for writes | |||
services map[string]uint64 | |||
operations map[string]map[string]uint64 | |||
operations map[string]map[trace.SpanKind]map[string]uint64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment explaining the structure of the map, which is quite complex
kind, _ := span.GetSpanKind() | ||
kindString := strconv.FormatInt(int64(rune(kind)), 10) | ||
// This format will convert length of service name to formatted 3-digit number (string) like for 9 it will change to "009" | ||
formattedLengthOfService := fmt.Sprintf("%03d", len(span.Process.ServiceName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to get services, operation name and kind from the single index. Kind will be the last character of the key but we have to differentiate between service name and operation name, so storing the length of service name. Currently I am thinking to change the key to len(serviceName)+"L"+serviceName+operation name+kind
model/span.go
Outdated
return trace.SpanKindUnspecified | ||
} | ||
|
||
func GetSpanKindFromStringOfSpanKind(s string) trace.SpanKind { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does this mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will change "0" (and other integral string) to trace.SpanKind
then we should return all operations regardless of the span kind |
That means including all spans of old data also (Whose kind is not there in cache)? |
Signed-off-by: Manik Mehta <[email protected]>
Signed-off-by: Manik2708 <[email protected]>
Signed-off-by: Manik2708 <[email protected]>
Signed-off-by: Manik2708 <[email protected]>
Signed-off-by: Manik2708 <[email protected]>
Signed-off-by: Manik2708 <[email protected]>
My current approach is leading to errors in unit test of
This is probably because
The only problem is that, during prefilling 6*NumberOfOperations Get Queries will be called. Please review this approach @yurishkuro and I think we need to discuss about autoCreation of new index or should we skip the creation of any new index and use the function given above? |
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test