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 esmapping-generator into jaeger binary #6327

Merged
merged 5 commits into from
Jan 23, 2025

Conversation

Rohanraj123
Copy link
Contributor

@Rohanraj123 Rohanraj123 commented Dec 8, 2024

Which problem is this PR solving?

Description of the changes

  • Decoupled the Esmapping generation logic from cmd/esmappnig-generator/main.go and kept it into reusable renderer package and then reimplemented the subcommand in the plugin/storage/es/esmapping-generator.go file and then registered in jaeger/main.go.

How was this change tested?

  • go test ./... -count=1

Checklist

@Rohanraj123 Rohanraj123 marked this pull request as ready for review December 8, 2024 18:36
@Rohanraj123 Rohanraj123 requested a review from a team as a code owner December 8, 2024 18:36
@dosubot dosubot bot added the area/storage label Dec 8, 2024
@Rohanraj123
Copy link
Contributor Author

@yurishkuro I think now this is perfectly decoupling the logic for generation in tool and then calling it from jaeger binary. Looking forward to your suggestions!

Copy link

codecov bot commented Dec 8, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 96.23%. Comparing base (04b1ea4) to head (757b117).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
...mapping-generator/generator/esmapping_generator.go 66.66% 2 Missing and 1 partial ⚠️
internal/storage/elasticsearch/mapping/command.go 80.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6327      +/-   ##
==========================================
- Coverage   96.23%   96.23%   -0.01%     
==========================================
  Files         373      377       +4     
  Lines       21406    21421      +15     
==========================================
+ Hits        20600    20614      +14     
  Misses        614      614              
- Partials      192      193       +1     
Flag Coverage Δ
badger_v1 10.63% <ø> (-0.02%) ⬇️
badger_v2 2.78% <ø> (+<0.01%) ⬆️
cassandra-4.x-v1-manual 16.64% <ø> (+0.05%) ⬆️
cassandra-4.x-v2-auto 2.72% <ø> (+<0.01%) ⬆️
cassandra-4.x-v2-manual 2.72% <ø> (+<0.01%) ⬆️
cassandra-5.x-v1-manual 16.64% <ø> (+0.05%) ⬆️
cassandra-5.x-v2-auto 2.72% <ø> (+<0.01%) ⬆️
cassandra-5.x-v2-manual 2.72% <ø> (+<0.01%) ⬆️
elasticsearch-6.x-v1 20.43% <ø> (+0.06%) ⬆️
elasticsearch-7.x-v1 20.50% <ø> (+0.06%) ⬆️
elasticsearch-8.x-v1 20.66% <ø> (+0.06%) ⬆️
elasticsearch-8.x-v2 2.77% <ø> (+<0.01%) ⬆️
grpc_v1 12.20% <ø> (+0.05%) ⬆️
grpc_v2 9.06% <ø> (+0.03%) ⬆️
kafka-3.x-v1 10.36% <ø> (+0.03%) ⬆️
kafka-3.x-v2 2.78% <ø> (+<0.01%) ⬆️
memory_v2 2.78% <ø> (+<0.01%) ⬆️
opensearch-1.x-v1 20.56% <ø> (+0.07%) ⬆️
opensearch-2.x-v1 20.55% <ø> (+0.06%) ⬆️
opensearch-2.x-v2 2.78% <ø> (+<0.01%) ⬆️
tailsampling-processor 0.51% <ø> (+<0.01%) ⬆️
unittests 95.08% <75.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.

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.

how is a user expected to run this?

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 overall, but some cleanup required

Signed-off-by: Rohanraj123 <rajrohan88293@gmail.com>
"github.com/jaegertracing/jaeger/cmd/esmapping-generator/generator"
)

func Command(options app.Options) *cobra.Command {
Copy link
Member

Choose a reason for hiding this comment

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

Why do you need options as argument? It seems it's always passed as zero value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For testing purpose.

Copy link
Member

@yurishkuro yurishkuro Jan 22, 2025

Choose a reason for hiding this comment

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

it's not used in any way in tests. You set the params by passing CLI flags.

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 !

Signed-off-by: Rohanraj123 <rajrohan88293@gmail.com>
Signed-off-by: Rohanraj123 <rajrohan88293@gmail.com>
Signed-off-by: Rohanraj123 <rajrohan88293@gmail.com>
Signed-off-by: Rohanraj123 <rajrohan88293@gmail.com>
@yurishkuro yurishkuro merged commit 3cfff2d into jaegertracing:main Jan 23, 2025
54 of 55 checks passed
@yurishkuro
Copy link
Member

Thanks!

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