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

Add Elasticsearch storage support for adaptive sampling #5158

Merged
merged 63 commits into from
Feb 27, 2024

Conversation

Pushkarm029
Copy link
Member

@Pushkarm029 Pushkarm029 commented Feb 2, 2024

Which problem is this PR solving?

Description of the changes

  • Implemented Elasticsearch storage for adaptive sampling

How was this change tested?

  • not tested yet

Checklist

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@Pushkarm029 Pushkarm029 requested a review from a team as a code owner February 2, 2024 05:19
@Pushkarm029 Pushkarm029 requested a review from jkowall February 2, 2024 05:19
@Pushkarm029
Copy link
Member Author

Raised PR to get to know from reviewers whether I am on the right track or not.

@Pushkarm029
Copy link
Member Author

adding tests

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.56%. Comparing base (7a04461) to head (851f37c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5158      +/-   ##
==========================================
+ Coverage   94.49%   94.56%   +0.07%     
==========================================
  Files         334      336       +2     
  Lines       19303    19501     +198     
==========================================
+ Hits        18241    18442     +201     
+ Misses        875      871       -4     
- Partials      187      188       +1     
Flag Coverage Δ
cassandra-3.x 24.94% <0.00%> (-0.59%) ⬇️
cassandra-4.x 24.94% <0.00%> (-0.59%) ⬇️
elasticsearch-5.x 21.65% <78.61%> (+1.83%) ⬆️
elasticsearch-6.x 21.65% <78.61%> (+1.83%) ⬆️
elasticsearch-7.x 21.79% <78.61%> (+1.83%) ⬆️
elasticsearch-8.x 21.88% <78.61%> (+1.84%) ⬆️
grpc-badger 19.11% <0.00%> (-0.36%) ⬇️
kafka 13.74% <0.00%> (-0.33%) ⬇️
opensearch-1.x 21.79% <78.61%> (+1.83%) ⬆️
opensearch-2.x 21.78% <78.61%> (+1.81%) ⬆️
unittests 92.39% <97.18%> (+0.03%) ⬆️

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.

@yurishkuro yurishkuro added the changelog:exprimental Change to an experimental part of the code label Feb 8, 2024
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.

  • run make fmt
  • please add tests to all new functionality
  • enable integration tests (see plugin/storage/integration/integration.go:423)

plugin/storage/es/samplingstore/storage.go Outdated Show resolved Hide resolved
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@Pushkarm029
Copy link
Member Author

Enabling integration tests

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@Pushkarm029
Copy link
Member Author

The Tests are failing because the GetLatestProbability is failing

    integration.go:466: 
        	Error Trace:	/home/runner/work/jaeger/jaeger/plugin/storage/integration/integration.go:466
        	Error:      	Should be true
        	Test:       	TestElasticsearchStorage/GetLatestProbability
    integration.go:467: 	 Expected: map[new-srv:map[op:0.1]]
    integration.go:468: 	 Actual  : map[new-srv3:map[op:0.123]]

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@Pushkarm029
Copy link
Member Author

any idea @yurishkuro, why it is failing on es v5 but not on v7 and v8.

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@Pushkarm029 Pushkarm029 marked this pull request as draft February 10, 2024 05:00
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@Pushkarm029
Copy link
Member Author

added rollover support

@Pushkarm029
Copy link
Member Author

Please review.

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.

almost there!

cmd/es-rollover/app/index_options.go Show resolved Hide resolved
cmd/es-rollover/app/index_options_test.go Outdated Show resolved Hide resolved
pkg/es/config/config.go Outdated Show resolved Hide resolved
plugin/storage/es/factory.go Outdated Show resolved Hide resolved
plugin/storage/es/mappings/jaeger-sampling-7.json Outdated Show resolved Hide resolved
plugin/storage/es/samplingstore/storage.go Outdated Show resolved Hide resolved
plugin/storage/es/samplingstore/storage.go Outdated Show resolved Hide resolved
plugin/storage/es/samplingstore/storage.go Outdated Show resolved Hide resolved
plugin/storage/es/samplingstore/storage.go Outdated Show resolved Hide resolved
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@Pushkarm029
Copy link
Member Author

tests are also failing. looks like i have to add adaptive sampling in this cmd/es-index-cleaner/app/flags.go Config also????

@yurishkuro
Copy link
Member

tests are also failing. looks like i have to add adaptive sampling in this cmd/es-index-cleaner/app/flags.go Config also????

heh, I left a comment about that, but why would have any impact on the tests? The cleaner is just over-eager in which indices it removes, but unless the integration tests are actually testing for this behavior I would expect to be a no-op (because either rollover will create extra indices and things would work, or it wouldn't create them and cleaner will be no-op).

are you able to run these integration tests locally?

@yurishkuro
Copy link
Member

I see this error, maybe you're not passing extra flags inside the integration test to actually generate sampling-related index?

        	            	listA:
        	            	([]string) (len=3) {
        	            	 (string) (len=34) "integration-test-jaeger-span-write",
        	            	 (string) (len=37) "integration-test-jaeger-service-write",
        	            	 (string) (len=42) "integration-test-jaeger-dependencies-write"
        	            	}
        	            	
        	            	
        	            	listB:
        	            	([]string) (len=4) {
        	            	 (string) (len=37) "integration-test-jaeger-service-write",
        	            	 (string) (len=34) "integration-test-jaeger-span-write",
        	            	 (string) (len=42) "integration-test-jaeger-dependencies-write",
        	            	 (string) (len=38) "integration-test-jaeger-sampling-write"
        	            	}

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@Pushkarm029
Copy link
Member Author

Pushkarm029 commented Feb 25, 2024

are you able to run these integration tests locally?

YES, but sometimes it fails with a timeout, in that case, I rely on gh workflow

I see this error, maybe you're not passing extra flags inside the integration test to actually generate sampling-related index?

working on it

Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
Signed-off-by: Pushkar Mishra <pushkarmishra029@gmail.com>
@Pushkarm029
Copy link
Member Author

🤞everything seems good now.

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.

🎉

@yurishkuro yurishkuro merged commit d72a9b0 into jaegertracing:main Feb 27, 2024
35 checks passed
@Pushkarm029 Pushkarm029 deleted the elasticSearch_Sampling branch February 27, 2024 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:exprimental Change to an experimental part of the code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants