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

[query] Use OTEL's helpers for grpc server #6055

Merged
merged 30 commits into from
Oct 24, 2024

Conversation

mahadzaryab1
Copy link
Collaborator

@mahadzaryab1 mahadzaryab1 commented Oct 5, 2024

Which problem is this PR solving?

Description of the changes

  • Migrates the GRPC query server to create the server using OTEL rather than using a custom implementation
  • Adds a log to warn users that having the same port for GRPC and HTTP is now deprecated. We'll be removing this functionality after Feb 2025.

How was this change tested?

  • Unit tests / CI

Checklist

Copy link

codecov bot commented Oct 5, 2024

Codecov Report

Attention: Patch coverage is 96.55172% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.45%. Comparing base (f9474f9) to head (98eabd5).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...md/jaeger/internal/extension/jaegerquery/server.go 66.66% 0 Missing and 1 partial ⚠️
cmd/query/app/server.go 97.29% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6055      +/-   ##
==========================================
- Coverage   96.48%   96.45%   -0.03%     
==========================================
  Files         352      352              
  Lines       19973    20007      +34     
==========================================
+ Hits        19270    19297      +27     
- Misses        520      526       +6     
- Partials      183      184       +1     
Flag Coverage Δ
badger_v1 8.42% <ø> (ø)
badger_v2 1.70% <ø> (ø)
cassandra-4.x-v1 14.57% <ø> (ø)
cassandra-4.x-v2 1.64% <ø> (ø)
cassandra-5.x-v1 14.57% <ø> (ø)
cassandra-5.x-v2 1.64% <ø> (ø)
elasticsearch-6.x-v1 18.72% <ø> (ø)
elasticsearch-7.x-v1 18.80% <ø> (ø)
elasticsearch-8.x-v1 18.97% <ø> (-0.02%) ⬇️
elasticsearch-8.x-v2 1.70% <ø> (ø)
grpc_v1 8.78% <ø> (ø)
grpc_v2 6.72% <ø> (ø)
kafka-v1 8.99% <ø> (ø)
kafka-v2 1.70% <ø> (ø)
memory_v2 1.70% <ø> (ø)
opensearch-1.x-v1 18.86% <ø> (+0.01%) ⬆️
opensearch-2.x-v1 18.86% <ø> (ø)
opensearch-2.x-v2 1.70% <ø> (ø)
tailsampling-processor 0.48% <ø> (ø)
unittests 95.37% <96.55%> (-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.

@mahadzaryab1
Copy link
Collaborator Author

@yurishkuro do you have any thoughts on how to handle the sharing of ports problem?

@yurishkuro
Copy link
Member

We should follow our deprecation policy of two versions notice. It means for v2 we can go to new method and distinct port. For v1 we need to print a warning if the same port is used telling the user this will not be supported in the future (call it out in release notes). Then two releases later we switch default to not allow same port but still support it via a special flag (deprecated from start), and then two releases later remove that too.

This also means we should have another release tag "deprecated" and change release notes script to have a separate section for it.

@mahadzaryab1
Copy link
Collaborator Author

We should follow our deprecation policy of two versions notice. It means for v2 we can go to new method and distinct port. For v1 we need to print a warning if the same port is used telling the user this will not be supported in the future (call it out in release notes). Then two releases later we switch default to not allow same port but still support it via a special flag (deprecated from start), and then two releases later remove that too.

This also means we should have another release tag "deprecated" and change release notes script to have a separate section for it.

Got it! Let me make some changes.

@mahadzaryab1
Copy link
Collaborator Author

@yurishkuro do you have any thoughts so far? it looks pretty messy but i'm not sure if there's a cleaner way to do this.

cmd/query/app/server.go Outdated Show resolved Hide resolved
cmd/query/app/server.go Outdated Show resolved Hide resolved
cmd/query/app/server.go Outdated Show resolved Hide resolved
cmd/query/app/server.go Outdated Show resolved Hide resolved
@mahadzaryab1
Copy link
Collaborator Author

@yurishkuro do you know why the all in one test is failing by any chance?

@yurishkuro
Copy link
Member

should have 1 item(s), but has 2

It seems some unexpected spans are being created. This may not necessary be a bad thing, i.e. we may need to adjust the test to allow that. I'd recommend running the test with commented out docker kill so that you can go and inspect the trace in Jaeger UI in order to understand what exactly is being created and whether we want it.

@mahadzaryab1
Copy link
Collaborator Author

should have 1 item(s), but has 2

It seems some unexpected spans are being created. This may not necessary be a bad thing, i.e. we may need to adjust the test to allow that. I'd recommend running the test with commented out docker kill so that you can go and inspect the trace in Jaeger UI in order to understand what exactly is being created and whether we want it.

@yurishkuro This is what I'm seeing in the jaeger UI. What're your thoughts?

Screenshot 2024-10-19 at 10 32 56 PM

@yurishkuro
Copy link
Member

The /api/traces request, is it a GET or a POST? Get is ok to trace, post is not.

@mahadzaryab1
Copy link
Collaborator Author

The /api/traces request, is it a GET or a POST? Get is ok to trace, post is not.

@yurishkuro It looks to be a GET request.

Screenshot 2024-10-20 at 1 25 19 PM

@yurishkuro
Copy link
Member

Ok, then how is it different from how the test worked before your change? Did we not have tracing on that endpoint?

@mahadzaryab1
Copy link
Collaborator Author

@yurishkuro It looks like the second trace that's the one that is new

@yurishkuro
Copy link
Member

I think we should improve selectivity of the test - it should not be breaking if some extra trace is created, its objective is to check that the trace it needs is created.

cmd/all-in-one/main.go Outdated Show resolved Hide resolved
cmd/query/app/server.go Outdated Show resolved Hide resolved
cmd/query/app/server.go Outdated Show resolved Hide resolved
cmd/query/app/server.go Outdated Show resolved Hide resolved
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>
@mahadzaryab1 mahadzaryab1 changed the title [WIP] [query] use otel's implementation for constructing http and grpc servers [query] Use OTEL's implementation for constructing grpc query server Oct 23, 2024
@mahadzaryab1 mahadzaryab1 marked this pull request as ready for review October 23, 2024 22:58
@mahadzaryab1 mahadzaryab1 requested a review from a team as a code owner October 23, 2024 22:58
@mahadzaryab1 mahadzaryab1 requested a review from jkowall October 23, 2024 22:58
@dosubot dosubot bot added the area/otel label Oct 23, 2024
cmd/query/app/flags.go Outdated Show resolved Hide resolved
cmd/query/app/server.go Outdated Show resolved Hide resolved
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 yurishkuro changed the title [query] Use OTEL's implementation for constructing grpc query server [query] Use OTEL's helpers for grpc server Oct 24, 2024
@yurishkuro yurishkuro merged commit c96790a into jaegertracing:main Oct 24, 2024
49 checks passed
yurishkuro pushed a commit that referenced this pull request Oct 25, 2024
## Which problem is this PR solving?
- Towards #6026 

## Description of the changes
- Fixes an issue from #6055
where the condition for routing to the legacy implementation was
accidentally flipped.

## How was this change tested?
- CI

## 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`: `yarn lint` and `yarn test`

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
yurishkuro added a commit to yurishkuro/jaeger that referenced this pull request Nov 2, 2024
@mahadzaryab1 mahadzaryab1 deleted the otel-servers branch November 23, 2024 01:32
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