Skip to content

[ES] Refactor FindTraces and GetTrace of SpanReader to make them reusable for v2 APIs#6845

Merged
yurishkuro merged 14 commits intojaegertracing:mainfrom
Manik2708:es-reader
Mar 18, 2025
Merged

[ES] Refactor FindTraces and GetTrace of SpanReader to make them reusable for v2 APIs#6845
yurishkuro merged 14 commits intojaegertracing:mainfrom
Manik2708:es-reader

Conversation

@Manik2708
Copy link
Copy Markdown
Contributor

Which problem is this PR solving?

Fixes a part of: #6458

Description of the changes

  • Refactoring of FindTraces and GetTrace to complete refactoring for ES Span Reader

How was this change tested?

  • Unit tests

Checklist

@Manik2708 Manik2708 requested a review from a team as a code owner March 12, 2025 19:11
@Manik2708 Manik2708 requested a review from mahadzaryab1 March 12, 2025 19:11
@Manik2708
Copy link
Copy Markdown
Contributor Author

Fixing tests!

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.05%. Comparing base (2be68dc) to head (76f3892).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6845      +/-   ##
==========================================
- Coverage   96.05%   96.05%   -0.01%     
==========================================
  Files         367      368       +1     
  Lines       20831    20844      +13     
==========================================
+ Hits        20010    20021      +11     
- Misses        626      628       +2     
  Partials      195      195              
Flag Coverage Δ
badger_v1 9.87% <0.00%> (-0.02%) ⬇️
badger_v2 2.05% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1-manual 14.85% <0.00%> (-0.02%) ⬇️
cassandra-4.x-v2-auto 2.04% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v2-manual 2.04% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v1-manual 14.85% <0.00%> (-0.02%) ⬇️
cassandra-5.x-v2-auto 2.04% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v2-manual 2.04% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x-v1 19.49% <74.62%> (-0.06%) ⬇️
elasticsearch-7.x-v1 19.57% <74.62%> (-0.06%) ⬇️
elasticsearch-8.x-v1 19.74% <74.62%> (-0.06%) ⬇️
elasticsearch-8.x-v2 2.05% <0.00%> (-0.01%) ⬇️
grpc_v1 10.90% <0.00%> (-0.02%) ⬇️
grpc_v2 7.97% <0.00%> (-0.02%) ⬇️
kafka-3.x-v1 10.16% <0.00%> (-0.02%) ⬇️
kafka-3.x-v2 2.05% <0.00%> (-0.01%) ⬇️
memory_v2 2.05% <0.00%> (-0.01%) ⬇️
opensearch-1.x-v1 19.62% <74.62%> (-0.06%) ⬇️
opensearch-2.x-v1 19.62% <74.62%> (-0.06%) ⬇️
opensearch-2.x-v2 2.05% <0.00%> (-0.01%) ⬇️
tailsampling-processor 0.55% <0.00%> (-0.01%) ⬇️
unittests 94.90% <97.01%> (-0.04%) ⬇️

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.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

github-merge-queue bot pushed a commit that referenced this pull request Mar 14, 2025
## Which problem is this PR solving?
Fixes a part of #6458 

## Description of the changes
- As discussed in the comment
#6845 (comment),
legacy trace id is moved to feature gate

## How was this change tested?
- Unit and Integration tests

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
@Manik2708 Manik2708 requested a review from yurishkuro March 15, 2025 13:41
Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
@Manik2708 Manik2708 requested a review from yurishkuro March 16, 2025 14:27
{
traceID: traceIDHigh,
query: elastic.NewTermQuery(traceIDField, "00000000000000010000000000000001"),
disableLegacyIdsEnabled: true,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this same test with false should produce two queries, one of them for 10000000000000001

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's already there, please see the second test

Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
Signed-off-by: Manik2708 <mehtamanik96@gmail.com>

// Trace is the type of traces
type Trace struct {
Spans []*Span
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

can we do without pointer?

Suggested change
Spans []*Span
Spans []Span

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Even I wanted to do that but then I was concerned that it might increase the diff, as all the methods in core reader are returing pointers. Should I do that refactoring in this PR? Or a separate PR after this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Next pr

// GetTrace takes a traceID and returns a Trace associated with that traceID
GetTrace(ctx context.Context, query spanstore.GetTraceParameters) (*model.Trace, error)
// GetTraces takes a traceID and returns a Trace associated with that traceID
GetTraces(ctx context.Context, query []dbmodel.TraceID) ([]*dbmodel.Trace, error)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

in the next PR can we try to get rid of all the pointers in the signatures? They are not providing any value, only forcing extra memory allocations.

Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
@Manik2708 Manik2708 requested a review from yurishkuro March 18, 2025 15:39
@yurishkuro yurishkuro enabled auto-merge March 18, 2025 16:20
@yurishkuro yurishkuro added this pull request to the merge queue Mar 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Mar 18, 2025
@yurishkuro yurishkuro added this pull request to the merge queue Mar 18, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 18, 2025
@yurishkuro yurishkuro added this pull request to the merge queue Mar 18, 2025
Merged via the queue into jaegertracing:main with commit 5455967 Mar 18, 2025
56 checks passed
@Manik2708 Manik2708 deleted the es-reader branch March 19, 2025 09:08
sAchin-680 pushed a commit to sAchin-680/jaeger that referenced this pull request Mar 19, 2025
…reusable for v2 APIs (jaegertracing#6845)

## Which problem is this PR solving?
Fixes a part of: jaegertracing#6458

## Description of the changes
- Refactoring of `FindTraces` and `GetTrace` to complete refactoring for
ES Span Reader

## How was this change tested?
- Unit tests

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
Signed-off-by: sAchin-680 <mrmister680@gmail.com>
amilbcahat pushed a commit to amilbcahat/jaeger that referenced this pull request May 4, 2025
…gertracing#6848)

## Which problem is this PR solving?
Fixes a part of jaegertracing#6458 

## Description of the changes
- As discussed in the comment
jaegertracing#6845 (comment),
legacy trace id is moved to feature gate

## How was this change tested?
- Unit and Integration tests

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
amilbcahat pushed a commit to amilbcahat/jaeger that referenced this pull request May 4, 2025
…reusable for v2 APIs (jaegertracing#6845)

## Which problem is this PR solving?
Fixes a part of: jaegertracing#6458 

## Description of the changes
- Refactoring of `FindTraces` and `GetTrace` to complete refactoring for
ES Span Reader

## How was this change tested?
- Unit tests

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
amilbcahat pushed a commit to amilbcahat/jaeger that referenced this pull request May 4, 2025
…gertracing#6848)

## Which problem is this PR solving?
Fixes a part of jaegertracing#6458

## Description of the changes
- As discussed in the comment
jaegertracing#6845 (comment),
legacy trace id is moved to feature gate

## How was this change tested?
- Unit and Integration tests

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
Signed-off-by: amol-verma-allen <amol.verma@allen.in>
amilbcahat pushed a commit to amilbcahat/jaeger that referenced this pull request May 4, 2025
…reusable for v2 APIs (jaegertracing#6845)

## Which problem is this PR solving?
Fixes a part of: jaegertracing#6458

## Description of the changes
- Refactoring of `FindTraces` and `GetTrace` to complete refactoring for
ES Span Reader

## How was this change tested?
- Unit tests

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Manik2708 <mehtamanik96@gmail.com>
Signed-off-by: amol-verma-allen <amol.verma@allen.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants