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

[feat] Add time window for GetTrace in span store interface #6242

Conversation

rim99
Copy link
Contributor

@rim99 rim99 commented Nov 23, 2024

Which problem is this PR solving?

Part of #4150

Description of the changes

Refactor trace get method in span store interface:

  • use struct instead of literal trace id
  • add time window in the new struct

How was this change tested?

  • unit test

Checklist

@rim99 rim99 force-pushed the refactor-span-store-interface-add-time-window branch from fcd8538 to 5e2d862 Compare November 23, 2024 01:40
@rim99 rim99 marked this pull request as ready for review November 23, 2024 01:41
@rim99 rim99 requested a review from a team as a code owner November 23, 2024 01:41
@rim99 rim99 requested a review from albertteoh November 23, 2024 01:41
plugin/storage/grpc/shared/grpc_handler.go Outdated Show resolved Hide resolved
plugin/storage/es/spanstore/reader.go Show resolved Hide resolved
cmd/query/app/http_handler.go Show resolved Hide resolved
cmd/query/app/grpc_handler.go Outdated Show resolved Hide resolved
cmd/query/app/grpc_handler.go Outdated Show resolved Hide resolved
cmd/query/app/apiv3/http_gateway.go Show resolved Hide resolved
cmd/query/app/apiv3/grpc_handler.go Outdated Show resolved Hide resolved
gw.getTracesAndVerify(t, "/api/v3/traces/"+traceID.String(), traceID)
trace, query := makeTestTrace()
gw.reader.On("GetTrace", matchContext, query).Return(trace, nil).Once()
gw.getTracesAndVerify(t, "/api/v3/traces/"+query.TraceID.String(), query.TraceID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could introduce a preliminary PR that adds timestamps args to the REST API calls

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here: #6248

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that PR doesn't seem to compile, can you get it to green state?

Copy link
Contributor Author

@rim99 rim99 Nov 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is a PR contains changes of current PR, and the PR above: #6258

cmd/jaeger/internal/integration/span_reader.go Outdated Show resolved Hide resolved
@rim99 rim99 force-pushed the refactor-span-store-interface-add-time-window branch from 5e2d862 to 5610442 Compare November 24, 2024 03:00
Copy link

codecov bot commented Nov 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.11%. Comparing base (d3d70e0) to head (c08509a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6242      +/-   ##
==========================================
- Coverage   96.12%   96.11%   -0.01%     
==========================================
  Files         360      360              
  Lines       20433    20479      +46     
==========================================
+ Hits        19641    19684      +43     
- Misses        605      607       +2     
- Partials      187      188       +1     
Flag Coverage Δ
badger_v1 8.96% <9.52%> (-0.02%) ⬇️
badger_v2 1.63% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1-manual 14.93% <11.90%> (-0.03%) ⬇️
cassandra-4.x-v2-auto 1.57% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v2-manual 1.57% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v1-manual 14.93% <11.90%> (-0.03%) ⬇️
cassandra-5.x-v2-auto 1.57% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v2-manual 1.57% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x-v1 18.61% <11.90%> (-0.02%) ⬇️
elasticsearch-7.x-v1 18.70% <11.90%> (-0.02%) ⬇️
elasticsearch-8.x-v1 18.86% <11.90%> (-0.02%) ⬇️
elasticsearch-8.x-v2 1.62% <0.00%> (-0.02%) ⬇️
grpc_v1 10.59% <52.38%> (+0.09%) ⬆️
grpc_v2 7.95% <21.42%> (+0.02%) ⬆️
kafka-v1 9.28% <4.76%> (-0.02%) ⬇️
kafka-v2 1.63% <0.00%> (-0.01%) ⬇️
memory_v2 1.63% <0.00%> (+<0.01%) ⬆️
opensearch-1.x-v1 18.74% <11.90%> (-0.03%) ⬇️
opensearch-2.x-v1 18.75% <11.90%> (-0.01%) ⬇️
opensearch-2.x-v2 1.63% <0.00%> (+<0.01%) ⬆️
tailsampling-processor 0.45% <0.00%> (-0.01%) ⬇️
unittests 94.99% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rim99 rim99 force-pushed the refactor-span-store-interface-add-time-window branch 3 times, most recently from 289e0a8 to 7c37eee Compare November 24, 2024 04:08
@yurishkuro yurishkuro added the changelog:new-feature Change that should be called out as new feature in CHANGELOG label Nov 24, 2024
@rim99 rim99 force-pushed the refactor-span-store-interface-add-time-window branch from fd25a38 to 16da94c Compare November 24, 2024 23:51
@rim99
Copy link
Contributor Author

rim99 commented Nov 25, 2024

PR updated, please review, thanks @yurishkuro

@rim99 rim99 force-pushed the refactor-span-store-interface-add-time-window branch from 56f361a to 5edb49b Compare November 25, 2024 23:27
Comment on lines 109 to 110
for _, input := range inputs {
tsc := newTestServerClient(t)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for _, input := range inputs {
tsc := newTestServerClient(t)
for _, input := range inputs {
t.Run(input.name, func(t *testing.T) {
tsc := newTestServerClient(t)
...
})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

rim99 and others added 3 commits November 26, 2024 20:16
Signed-off-by: rim99 <zhangxin@outlook.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Signed-off-by: Zhang Xin <zxin3306@126.com>
rim99 and others added 8 commits November 26, 2024 20:16
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Signed-off-by: Zhang Xin <zxin3306@126.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Signed-off-by: Zhang Xin <zxin3306@126.com>
Signed-off-by: rim99 <zhangxin@outlook.com>
Signed-off-by: rim99 <zhangxin@outlook.com>
Signed-off-by: rim99 <zhangxin@outlook.com>
Signed-off-by: rim99 <zhangxin@outlook.com>
Signed-off-by: rim99 <zhangxin@outlook.com>
Signed-off-by: rim99 <zhangxin@outlook.com>
@rim99 rim99 force-pushed the refactor-span-store-interface-add-time-window branch from af0dee9 to 491c826 Compare November 26, 2024 12:21
@yurishkuro
Copy link
Member

@rim99 could you please resolve the conflicts?

Signed-off-by: Zhang Xin <zhangxin@outlook.com>
@rim99 rim99 changed the title refactor: add time window for trace get method in span store interface feature: Add time window for trace get method in span store interface Dec 15, 2024
@rim99
Copy link
Contributor Author

rim99 commented Dec 15, 2024

@rim99 could you please resolve the conflicts?

Resolved. Could you please reivew?

yurishkuro and others added 2 commits December 15, 2024 13:43
Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro
Copy link
Member

TODOs added to

  • anonymizer/app/query/query.go
  • cmd/query/app/apiv3/http_gateway.go
  • cmd/query/app/http_handler.go (3 times)
  • plugin/storage/es/spanstore/reader.go

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yurishkuro yurishkuro changed the title feature: Add time window for trace get method in span store interface [feat] Add time window for GetTrace in span store interface Dec 15, 2024
@yurishkuro yurishkuro merged commit d6456fb into jaegertracing:main Dec 15, 2024
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage changelog:new-feature Change that should be called out as new feature in CHANGELOG enhancement storage/badger Issues related to badger storage storage/cassandra storage/elasticsearch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants