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

Support Tail Based Sampling Processor From OTEL Collector Extension #5878

Merged
merged 30 commits into from
Aug 31, 2024

Conversation

mahadzaryab1
Copy link
Contributor

@mahadzaryab1 mahadzaryab1 commented Aug 22, 2024

Which problem is this PR solving?

Description of the changes

  • Added the tail-based sampling processor extension from otel to jaeger
  • Added a docker compose to demonstrate usage of the tail-based sampling processor extension in jaeger.
  • Added an end to end integration test to test that the new processor works as expected
  • Added a README to the docker compose setup describing the setup and usage of the new processor

How was this change tested?

  • An end to end integration test was added and is run from the CI

Checklist

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.82%. Comparing base (9a30dfc) to head (c50ded3).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5878      +/-   ##
==========================================
- Coverage   96.83%   96.82%   -0.02%     
==========================================
  Files         342      342              
  Lines       16524    16525       +1     
==========================================
- Hits        16001    16000       -1     
- Misses        337      339       +2     
  Partials      186      186              
Flag Coverage Δ
badger_v1 8.05% <ø> (ø)
badger_v2 1.82% <ø> (ø)
cassandra-3.x-v1 16.62% <ø> (ø)
cassandra-3.x-v2 1.75% <ø> (ø)
cassandra-4.x-v1 16.62% <ø> (ø)
cassandra-4.x-v2 1.75% <ø> (ø)
elasticsearch-6.x-v1 18.79% <ø> (+0.01%) ⬆️
elasticsearch-7.x-v1 18.85% <ø> (+0.01%) ⬆️
elasticsearch-8.x-v1 19.03% <ø> (ø)
elasticsearch-8.x-v2 1.82% <ø> (ø)
grpc_v1 9.49% <ø> (ø)
grpc_v2 7.16% <ø> (ø)
kafka-v1 9.74% <ø> (ø)
kafka-v2 1.82% <ø> (ø)
memory_v2 1.82% <ø> (ø)
opensearch-1.x-v1 18.90% <ø> (+0.01%) ⬆️
opensearch-2.x-v1 18.90% <ø> (ø)
opensearch-2.x-v2 1.82% <ø> (ø)
tailsampling-processor 0.46% <ø> (?)
unittests 95.30% <100.00%> (-0.02%) ⬇️

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
Copy link
Member

I tested the binary sizes

  • without this change - 75Mb
  • with this change - 114Mb
  • with only tail sampler (without load balancer) - 78Mb

I would suggest we only include tail sampler. That's the component that's most useful in the final collector, which needs to be Jaeger. But the upstream load balancing collectors can be just OTEL Collectors.

@mahadzaryab1 mahadzaryab1 force-pushed the tail-based-sampling branch 3 times, most recently from 84a9b93 to 929c409 Compare August 24, 2024 23:28
@mahadzaryab1 mahadzaryab1 force-pushed the tail-based-sampling branch 2 times, most recently from 01c9743 to e15af38 Compare August 30, 2024 23:47
cmd/jaeger/internal/integration/tailsampling_test.go Outdated Show resolved Hide resolved
cmd/jaeger/internal/integration/tailsampling_test.go Outdated Show resolved Hide resolved
docker-compose/tail-sampling/Makefile Outdated Show resolved Hide resolved
docker-compose/tail-sampling/Makefile Outdated Show resolved Hide resolved
cmd/jaeger/internal/integration/tailsampling_test.go Outdated Show resolved Hide resolved
@@ -170,6 +170,10 @@ index-cleaner-integration-test: docker-images-elastic
index-rollover-integration-test: docker-images-elastic
$(MAKE) storage-integration-test COVEROUT=cover-index-rollover.out

.PHONY: tail-sampling-integration-test
tail-sampling-integration-test:
SAMPLING=tail $(MAKE) jaeger-v2-storage-integration-test
Copy link
Member

Choose a reason for hiding this comment

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

this runs go test, but when do you start the docker compose environment?

All other e2e tests have a driver script that orchestrates all components of the test, e.g. scripts/es-integration-test.sh

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not using the docker-compose environment for my test. Calling e2eInitialize is enough to start the Jaeger collector. You can simply run this test by calling make tail-sampling-integration-test. Let me know if you want to change any of this setup though.

Copy link
Member

Choose a reason for hiding this comment

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

Fair enough. However, it means that the new docker compose file will begin to rot since it's not being exercised by the CI, something we tried to avoid (e.g. see e2e spm test). So it would be good to actually combine using docker compose with e2e test.

Copy link
Contributor Author

@mahadzaryab1 mahadzaryab1 Aug 31, 2024

Choose a reason for hiding this comment

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

Ah I see! What would you want this to look like? The current docker-compose set up generates load using tracegen which ideally we wouldn't want in the integration test so we can manually generate those. And the existing setup in the E2E tests does some nice things for us like flush the storage in between tests.

Copy link
Member

Choose a reason for hiding this comment

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

Well, that's why I was asking from the start what your plan would be. The way you are using e2e_integration framework is very lightweight, and I could easily see an alternative setup where everything is just orchestrated from a shell script

  • run docker-compose with one config
    • maybe don't include tracegen in compose, run it manually
  • do a curl against query service to retrieve service names as JSON (trivial to write)
  • shut down docker-compose (to clear the storage) and run again with different config

If you are interested to pursue this approach, I would suggest still merging this PR first so that we already have something in place. Can you finish the README?

Copy link
Contributor Author

@mahadzaryab1 mahadzaryab1 Aug 31, 2024

Choose a reason for hiding this comment

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

@yurishkuro That sounds good to me and I can pursue that approach in a follow-up PR. And yes, working on the README now. Will push it up soon.

@yurishkuro
Copy link
Member

yurishkuro commented Aug 31, 2024

make sure to do git pull, I pushed updates to go.mod to resolve conflicts

@mahadzaryab1
Copy link
Contributor Author

make sure to do git pull, I pushed updates to go.mod to resolve conflicts

Thank you so much for doing this for me!

@yurishkuro yurishkuro added changelog:exprimental Change to an experimental part of the code v2 labels Aug 31, 2024
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
yurishkuro and others added 2 commits August 31, 2024 01:39
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@mahadzaryab1 mahadzaryab1 changed the title [WIP] feat: support tail based sampling from otel collector [WIP] feat: support tail based sampling from otel collector extension Aug 31, 2024
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@mahadzaryab1 mahadzaryab1 changed the title [WIP] feat: support tail based sampling from otel collector extension feat(processor): support tail based sampling processor from otel collector extension Aug 31, 2024
@mahadzaryab1 mahadzaryab1 changed the title feat(processor): support tail based sampling processor from otel collector extension Support Tail Based Sampling Processor From Otel Collector Extension Aug 31, 2024
@mahadzaryab1 mahadzaryab1 marked this pull request as ready for review August 31, 2024 16:47
@mahadzaryab1 mahadzaryab1 requested a review from a team as a code owner August 31, 2024 16:47
@dosubot dosubot bot added area/otel docker Pull requests that update Docker code enhancement labels Aug 31, 2024
@mahadzaryab1
Copy link
Contributor Author

mahadzaryab1 commented Aug 31, 2024

@yurishkuro the README and the rest of the PR is ready for review 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.

LGTM, thanks!

@mahadzaryab1
Copy link
Contributor Author

@yurishkuro - there looks to be a failing test in the CI. Is it a flaky test? I don't believe its related to my changes.

@mahadzaryab1 mahadzaryab1 changed the title Support Tail Based Sampling Processor From Otel Collector Extension Support Tail Based Sampling Processor From OTEL Collector Extension Aug 31, 2024
@yurishkuro yurishkuro merged commit 8ad6ed0 into jaegertracing:main Aug 31, 2024
50 checks passed
@yurishkuro
Copy link
Member

🎉 🎉 🎉

@mahadzaryab1 mahadzaryab1 deleted the tail-based-sampling branch August 31, 2024 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/otel changelog:exprimental Change to an experimental part of the code docker Pull requests that update Docker code enhancement v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support tail-based sampling from OTEL Collector
2 participants